elements icon indicating copy to clipboard operation
elements copied to clipboard

Schema view has no example for root allOf

Open philsturgeon opened this issue 4 years ago • 1 comments

Describe the bug

When an OpenAPI components.schema contains a schema which has a root allOf, it fails to generate an example on the model view.

To Reproduce

  1. Given this OpenAPI demo: https://elements-demo.stoplight.io/?spec=https://api.apis.guru/v2/specs/1password.com/events/1.0.0/openapi.json#/schemas/CursorCollection
  2. No example on the right

Expected behavior

I'd expect the allOf to be "flattened" so that we see all of the cursor properties and the has_more property, and that all should show up as an example on the right.

Additional context

The cursor is defined like this:

"CursorCollection": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Cursor"
          },
          {
            "properties": {
              "has_more": {
                "description": "Whether there may still be more data to fetch using the returned cursor. If true, the subsequent request could still be empty.",
                "type": "boolean"
              }
            }
          }
        ],
        "description": "Common cursor properties for collection responses"
      },

The full OpenAPI file is this: https://api.apis.guru/v2/specs/1password.com/events/1.0.0/openapi.json

Screenshots

image

(related to Zendesk ticket #6260)
gz#6260

philsturgeon avatar Oct 20 '21 13:10 philsturgeon

Similar, maybe related bug, notice how the description is also missing in the generated docs.

canvasplay avatar Mar 10 '22 12:03 canvasplay