Skip to content
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

[release/9.0] Harden schema reference transformer for relative references #59779

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

captainsafia
Copy link
Member

@captainsafia captainsafia commented Jan 8, 2025

Description

This PR resolves a set of issues that have been reported with schema reference resolution in the OpenAPI implementation. The crux of the issue deals with the way the underlying System.Text.Json generates relative references for schemas that include recursion or duplication.

Fixes #59677
Fixes #58968
Fixes #59427

Customer Impact

Resolves an issue with re-entrant schemas where no workarounds currently exist.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Low risk because:

  • Change is localized to Microsoft.AspNetCore.OpenApi package
  • Change is additive and doesn't change existing behavior

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

* Harden schema reference transformer for relative references

* Apply suggestions from code review

Co-authored-by: Brennan <brecon@microsoft.com>

* Remove uneeded setting

* One more cleanup

* Check for top-level schemas in tests

---------

Co-authored-by: Brennan <brecon@microsoft.com>
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jan 8, 2025
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0.x milestone Jan 8, 2025
@captainsafia captainsafia changed the title [release/9.0] Harden schema reference transformer for relative references (#59763) [release/9.0] Harden schema reference transformer for relative references Jan 8, 2025
@captainsafia captainsafia added Servicing-consider Shiproom approval is required for the issue area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc and removed area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework labels Jan 9, 2025
@captainsafia captainsafia marked this pull request as ready for review January 9, 2025 18:06
@captainsafia captainsafia requested a review from a team as a code owner January 9, 2025 18:06
@captainsafia captainsafia added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Jan 10, 2025
@captainsafia
Copy link
Member Author

Approved via email.

@captainsafia
Copy link
Member Author

@BrennanConroy Can I get your sign-off on this backport?

}
#nullable restore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢

…rs/Implementations/OpenApiSchemaReferenceTransformerTests.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants