-
Notifications
You must be signed in to change notification settings - Fork 63
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
Set request body to optional when all properties are optional #582
Comments
Once this is fixed and released, we should revert this PR. |
Updated the description here. Should be Odata |
Also, point of note is that, if |
According to the spec.
So what we should do is set it to true when required parameters are present... |
Trying to retrieve the annotations in-lined in the Action parameters fails to retrieve the var annotations = model.FindVocabularyAnnotationsIncludingInheritedAnnotations(parameter); <Parameter Name="transitive" Type="Edm.Boolean" Nullable="false">
<Annotation Term="Org.OData.Core.V1.OptionalParameter" />
</Parameter> Checking with the OData team to check for its support. |
Related to microsoftgraph/msgraph-sdk-java#2163 and microsoftgraph/msgraph-sdk-dotnet#2671 (comment)
In a scenario where all the properties in the request body are optional such as an odata action with all parameters being optional, we should set the
requestBody.required = false
in the generated openApi description otherwise explictly set it totrue
.https://spec.openapis.org/oas/v3.0.3.html#fixed-fields-10
This will unlock the generation of request body parameters in the SDKs as optional parameters in the builders to prevent breaking changes in scenarios where optional parametes are added.
The text was updated successfully, but these errors were encountered: