[OpenAPI] Add "type" property with value "object" response schema to fix Infragistics AppBuilder tooling #2283
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why make this change?
"type":"object"
key/value pair on the response child object schema breaks certain client tooling. in this case: Infragistics AppBuilder.Background
I found a relevant thread that discusses whether type is a required property. Consensus is that type isn't required:
OAI/OpenAPI-Specification#1657
OpenAPI-Specification discussion
PaloAltoNetworks/docusaurus-openapi-docs#430
Example of how different tooling handles type or missing type differently.
Ultimately, different tooling handles the presence of the type property differently. Some may try to guess the type when not present:
The fact that the type isn't required means that https://github.com/microsoft/OpenAPI.NET didn't complain about missing type. An error if type were required would have helped prevent this becoming an issue in the first place.
What is this change?
"type": "object"
to the openapi document for describing the response schema:How was this tested?
Sample Request(s)
View generated schema at