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

Open
wants to merge 1 commit into
base: release/9.0
Choose a base branch
from

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 <[email protected]>

* Remove uneeded setting

* One more cleanup

* Check for top-level schemas in tests

---------

Co-authored-by: Brennan <[email protected]>
@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 the Servicing-consider Shiproom approval is required for the issue label Jan 9, 2025
Copy link
Contributor

Hi @captainsafia. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

@captainsafia captainsafia added 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
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-consider Shiproom approval is required for the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant