Skip to content

Fix remaining ResolverFully recursion edge case - #2375

Open
bartolomeooo wants to merge 1 commit into
swagger-api:masterfrom
bartolomeooo:fix-resolverfully-oas31-self-recursion
Open

Fix remaining ResolverFully recursion edge case#2375
bartolomeooo wants to merge 1 commit into
swagger-api:masterfrom
bartolomeooo:fix-resolverfully-oas31-self-recursion

Conversation

@bartolomeooo

Copy link
Copy Markdown

Description

This PR fixes the issue described in #2374.

It addresses a remaining ResolverFully recursion edge case for an OpenAPI 3.1 self-referencing schema combined with allOf when parsing with resolve = true and resolveFully = true.

In this scenario, ResolverFully may re-attach a schema that is still present in schemasInProgress back into a newly aggregated schema, which can create a cyclic Java object graph.

This PR updates the recursive property re-attachment logic to treat in-progress schemas as recursive placeholders in this path, and adds a regression test covering the OAS 3.1 + allOf + self-reference case.

Fixes: #2374

Type of Change

  • 🐛 Bug fix
  • 🧪 Tests

Checklist

  • I have added/updated tests as needed
  • I have added/updated documentation where applicable
  • The PR title is descriptive
  • The code builds and passes tests locally
  • I have linked related issues (if any)

Screenshots / Additional Context

Regression test added for a minimal OpenAPI 3.1 reproducer with:

  • a self-referencing schema
  • allOf
  • resolveFully = true

The new fixture uses this minimal shape:

components:
  schemas:
    Node:
      type: object
      allOf:
        - type: object
          properties:
            value:
              type: number
      properties:
        child:
          $ref: '#/components/schemas/Node'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ResolverFully remaining recursion edge case after #2297 for OAS 3.1 self-referencing allOf schema

1 participant