-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Required parameters in a method are used across HTTP methods executor. #4148
Comments
Thanks for reporting this issue. Learning from the optimization work in the TypeScript world I've done over the past month, I think we should take this as an opportunity to have defaults and overrides, in order to save sizes when possible. Currently, most languages besides TypeScript are generated looking this way: at the constructor level public MessageItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/users/{user%2Did}/messages/{message%2Did}{?includeHiddenMessages*,%24select,%24expand}", rawUrl) {
} At the request generator level public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default) {
var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
return requestInfo;
} This UrlTemplate property was assigned by the constructor. We could still keep the same logic, but have another template in the generator when it differs. Thoughts? |
+1 on the suggestion here. We should do this. This should result in small changes in the generated code with only the parameter passed to the request generator level changing. |
Follow up to #3989
Taking a look at the url template
{+baseurl}/groups/{group%2Did}/members/$ref?@id={%40id}{&%24count,%24filter,%24orderby,%24search,%24skip,%24top}
generated from the description below.From the yaml description we conclude that
@id
parameter is only required for the DELETE methodhttps://graph.microsoft.com/v1.0/groups/groupId/members/$ref?@id=
which will result in an API error as seen here.To avoid the issue, the required parameters should be added to the template if they are in all methods or introduce secondary templates for such methods.
The text was updated successfully, but these errors were encountered: