-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for response summary in OpenAPI 3.2.0 #23
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
Add support for response summary in OpenAPI 3.2.0 #23
Conversation
…tion Co-authored-by: baywet <[email protected]>
Co-authored-by: baywet <[email protected]>
@copilot also update the IOpenAPIResponse interface to derive from ISummarizedElement |
Co-authored-by: baywet <[email protected]>
Updated the |
src/Microsoft.OpenApi/Models/References/OpenApiResponseReference.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OpenApi/Models/References/OpenApiResponseReference.cs
Outdated
Show resolved
Hide resolved
Signed-off-by: Vincent Biret <[email protected]>
Signed-off-by: Vincent Biret <[email protected]>
Signed-off-by: Vincent Biret <[email protected]>
Signed-off-by: Vincent Biret <[email protected]>
This PR implements support for the new
summary
field in response objects as defined in OpenAPI Specification 3.2.0.Changes Made
Core Implementation
Summary
property toOpenApiResponse
class implementingIOpenApiSummarizedElement
IOpenApiResponse
interface to derive fromIOpenApiSummarizedElement
making Summary part of the interface contractOpenApiResponseReference
to properly delegate the Summary property to its targetVersion-Specific Serialization
The implementation follows the specification requirements for backward compatibility:
OpenAPI 3.2+: Summary is serialized as a standard field
OpenAPI 3.1 and earlier: Summary is serialized as an extension field using the
x-oai-
prefixDeserialization Support
Testing
Usage Example
This implementation maintains full backward compatibility while enabling the new summary functionality for OpenAPI 3.2.0 documents. The interface hierarchy now properly expresses that all response objects have a Summary property.
Fixes #17
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.