Skip to content

Schema tree is truncated at nesting depth 9 since v11 #1160

Closed

Description

@patrickrobrecht

Since upgrading from RapiDoc 9.3.8 to 11.0.1, deeply nested response schemas are no longer rendered completely. Beyond a fixed nesting depth, properties are shown as empty objects ({ }) instead of their actual type (e.g. id: { } instead of id: integer).

The limit appears to be hard-coded in v11.0.1:

Why this matters

Depth 9 is reached quickly in realistic APIs without any recursion.

Example: response allOf (pagination + data) → data → items allOf (model + includes) → include → organization allOf (model + nested include) → location → Location allOf (base model + attributes) → id, city (level 9 → truncated)

The only workaround is restructuring the spec to avoid allOf levels. That is not always possible without duplicating schemas, and it makes the spec harder to maintain only to satisfy the renderer.

Minimal reproduction

openapi: 3.1.0
info:
  title: Depth limit reproduction
  version: 1.0.0
paths:
  /events:
    get:
      responses:
        '200':
          description: paginated list of events
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Pagination'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          allOf:
                            - $ref: '#/components/schemas/Event'
                            - $ref: '#/components/schemas/IncludeOrganization'
components:
  schemas:
    Base:
      type: object
      properties:
        id:
          type: integer
    Pagination:
      type: object
      properties:
        total:
          type: integer
    Event:
      allOf:
        - $ref: '#/components/schemas/Base'
        - type: object
          properties:
            name:
              type: string
    Organization:
      allOf:
        - $ref: '#/components/schemas/Base'
        - type: object
          properties:
            name:
              type: string
    Location:
      allOf:
        - $ref: '#/components/schemas/Base'
        - type: object
          properties:
            city:
              type: string
    IncludeOrganization:
      type: object
      properties:
        organization:
          allOf:
            - $ref: '#/components/schemas/Organization'
            - type: object
              properties:
                location:
                  $ref: '#/components/schemas/Location'

Expected (as in 9.3.8):

location: {
  id: integer
  city: string
}

Actual (11.0.1):

location: {
  id: { }
  city: { }
}

Proposal

Any of the following would solve the issue:

  1. Make the depth limit configurable, e.g. via a new attribute schema-max-depth (default 8 to keep the current behaviour).
  2. Only truncate real recursion: stop at schemas that are already being expanded on the current path (cycle detection) instead of at a fixed depth.
  3. Don't count allOf composition as a nesting level, because merging allOf subschemas does not add a level of nesting in the JSON.

Option 2 would be the most robust, because it prevents infinite recursion without cutting off legitimate deep schemas.

Activity

  1. added a commit that references this issue on Oct 26, 2026
    9a479b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions