Azure / data-api-builder

Data API builder provides modern REST and GraphQL endpoints to your Azure Databases and on-prem stores.
https://aka.ms/dab/docs
MIT License
786 stars 142 forks source link

[OpenAPI] Add "type" property with value "object" response schema to fix Infragistics AppBuilder tooling #2283

Open seantleonard opened 5 days ago

seantleonard commented 5 days ago

Why make this change?

Background

I found a relevant thread that discusses whether type is a required property. Consensus is that type isn't required:

https://github.com/OAI/OpenAPI-Specification/issues/1657 OpenAPI-Specification discussion https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/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?

How was this tested?

Sample Request(s)

View generated schema at

GET localhost:5001/api/openapi
abhishekkumams commented 1 hour ago

/azp run