forked from microsoft/OpenAPI.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for mediaType itemSchema property (OAS 3.2.0) #32
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
Merged
baywet
merged 8 commits into
feat/oai-3-2-support
from
copilot/fix-3c317057-370e-4d33-8171-b4b6862334fb
Oct 1, 2025
Merged
Add support for mediaType itemSchema property (OAS 3.2.0) #32
baywet
merged 8 commits into
feat/oai-3-2-support
from
copilot/fix-3c317057-370e-4d33-8171-b4b6862334fb
Oct 1, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: baywet <[email protected]>
Copilot finished work on behalf of
baywet
October 1, 2025 13:26
baywet
requested changes
Oct 1, 2025
Copilot finished work on behalf of
baywet
October 1, 2025 17:07
Signed-off-by: Vincent Biret <[email protected]>
…33-8171-b4b6862334fb
baywet
approved these changes
Oct 1, 2025
kilifu
approved these changes
Oct 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
✅ Successfully implemented support for the mediaType itemSchema property (OAI 3.2.0)
Summary of Changes
Core Implementation
IOpenApiSchema? ItemSchema
property toOpenApiMediaType
classItemSchema = "itemSchema"
constant toOpenApiConstants
SerializeInternal
method to:itemSchema
property for OpenAPI 3.2.0+x-oai-itemSchema
extension for OpenAPI 3.1.0 and 3.0.0 (backward compatibility)ItemSchema
propertyDeserialization Support
itemSchema
propertyx-oai-itemSchema
extension and map toItemSchema
propertyx-oai-itemSchema
extension and map toItemSchema
propertyTesting
ItemSchema
propertyPublicApi.approved.txt
to reflect new public API surfaceTest Results
Code Review Feedback Addressed
WriteOptionalObject
for x-oai-itemSchema serializationShould().BeEquivalentTo()
withAssert.Equivalent()
in V31 and V32 testsAssert.Equal()
withJsonNode.DeepEquals()
for JSON comparisonFiles Modified (11 files)
src/Microsoft.OpenApi/Models/OpenApiConstants.cs
- Added constantsrc/Microsoft.OpenApi/Models/OpenApiMediaType.cs
- Added property and serialization logicsrc/Microsoft.OpenApi/Reader/V3/OpenApiMediaTypeDeserializer.cs
- Added deserializationsrc/Microsoft.OpenApi/Reader/V31/OpenApiMediaTypeDeserializer.cs
- Added deserializationsrc/Microsoft.OpenApi/Reader/V32/OpenApiMediaTypeDeserializer.cs
- Added deserializationtest/Microsoft.OpenApi.Tests/Models/OpenApiMediaTypeTests.cs
- Added teststest/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt
- Updated public APItest/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiMediaTypeTests.cs
- Added testtest/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiMediaType/mediaTypeWithXOaiItemSchema.yaml
- Sampletest/Microsoft.OpenApi.Readers.Tests/V32Tests/OpenApiMediaTypeTests.cs
- Added testtest/Microsoft.OpenApi.Readers.Tests/V32Tests/Samples/OpenApiMediaType/mediaTypeWithItemSchema.yaml
- SampleImplementation follows OAS 3.2.0 specification and maintains backward compatibility with earlier versions.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.