Repository navigation
Fix mapping for nested schemas and [Produces] attributes in OpenAPI implementation - #57852
Merged
Merged
Conversation
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.
Description
This PR consists of two changes to address feedback received after .NET 9 RC 1 for the new APIs in the Microsoft.AspNetCore.OpenApi package.
[Produces]attribute with no-type would override the schema for a pre-existing schema by replacing direct assignment for content types withTryAddinOpenApiDocumentService.GetResponseAsync.OpenApiSchemaStore.PopulateSchemaIntoReferenceCache.Fixes #57799
Customer Impact
This PR resolves issues reported in the OpenAPI implementation that don't currently have any viable workarounds for users. Without these changes, documents generated by this implementation may unintentionally drop schemas for responses generated controller actions with certain attributes. This change also stabilizes the generations of schema names for deeply nested type hierarchies in the OpenAPI document.
Regression?
Risk
Changes in this PR only impact the
Microsoft.AspNetCore.OpenApiand don't affect any APIs in the shared framework. Changes are in new code paths that were introduced in .NET 9 so there is no risk of version-to-version regression.Verification
Packaging changes reviewed?