Redocly / Redocly/redoc

Multi-level allOf does not show

Open
#532 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

openapi
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

I have the following setup:

paths:
  /objects:
    post:
      operationId: addObject
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Obj'
components:
    schemas:
        Id:
            type: integer
            format: int64
            description: The ID of the object.
            example: 10765432100123456789
            readOnly: true
        IdString:
            type: string
            description: The ID of the object, in string format (for JavaScript)
            example: "10765432100123456789"
            readOnly: true
        IdObject:
            type: object
            description: Describes an object containing an ID.
            required:
            - Id
            properties:
            Id:
                $ref: '#/components/schemas/Id'
                readOnly: true
            IdString:
                $ref: '#/components/schemas/IdString'
                readOnly: true
        Obj:
            allOf:
            - $ref: '#/components/schemas/ObjCompact'
            - $ref: '#/components/schemas/ObjExtended'
        ObjCompact:
            allOf:
            - $ref: '#/components/schemas/IdObject'
            - type: object
                required:
                - Name
                properties:
                Name:
                    type: string
                    description: The name of the object.
                    example: ServerName01

In this schema, the properties in the ID object do not show in the final request body of /objects.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by loading the supplied OpenAPI schema in Redoc and inspect the /objects request-body rendering, focusing on nested allOf resolution. Done when properties inherited from IdObject appear in the final request body, including the Id and IdString fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.