Skip to content

Fix OpenApiJsonSchema array parsing (#62051) #62118

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

Open
wants to merge 2 commits into
base: release/9.0
Choose a base branch
from

Conversation

BrennanConroy
Copy link
Member

@BrennanConroy BrennanConroy commented May 27, 2025

Backport of #62051

Fix OpenApiJsonSchema array parsing

Description

When using the MapOpenApi() endpoint with a custom json converter that outputs an array with a default value, the app would crash with a stack overflow. The issue was that we never advanced the Utf8JsonReader when calling a recursive function. So we'd end up looking at the same json value over and over until stack overflowing.

Fixes #62023

Customer Impact

App can crash when accessing the OpenApi endpoint.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Obvious bug once pointed out. Fixed missing test coverage.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@BrennanConroy BrennanConroy added this to the 9.0.x milestone May 27, 2025
@BrennanConroy BrennanConroy requested review from captainsafia and a team as code owners May 27, 2025 18:39
@BrennanConroy BrennanConroy added Servicing-consider Shiproom approval is required for the issue feature-openapi labels May 27, 2025
@BrennanConroy BrennanConroy added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels May 28, 2025
Copy link
Contributor

Hi @@BrennanConroy. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-openapi Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants