Skip to content

Array items allOf does not output response schema correctly, example is correct #1123

@raldred

Description

@raldred

Describe the bug

When using allOf in array items, it does not output/render the schema drill down.
The example is rendered fine.

Expected behavior

The schema should be output correctly and expandable showing all properties

Current behavior

All the attributes of the array are missing from the schema

Possible solution

The object passed to the StatusCodes component, does not have allOf merged together, the plugin needs to generate markdown with the items of allOf merged, rather than outputting the allOf property?

If it's correct to output the allOf, then maybe the issue lies in lack of support for allOf in ResponseSchema` component or something it's composed of.

Steps to reproduce

  1. Create a path with a response schema
  2. Setup the response schema to include an property that is an array using allOf within items
    example:
responses:
  '200':
    description: List of resources
    content:
      application/vnd.api+json:
        schema:
          type: object
          properties:
            data:
              type: array
              items:
                allOf:
                  - properties:
                      one:
                        type: string
                  - properties:
                      two:
                        type: string

Screenshots

Image

Image

Context

I am unable to make up complex responses made up of refs, although the issue isn't specific to using refs as demonstrated, the issue seems to be specific to using allOf within an array items

Could it be something missing in the mergeAllOf method

Object passed in markdown looks to have everything correct passed to the StatusCodes component but the items contains the allOf property still, it's objects haven't been merged. Should they have?

"200": {
    "description": "List of resources",
    "content": {
      "application/vnd.api+json": {
        "schema": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "allOf": [
                  { "properties": { "one": { "type": "string" } } },
                  { "properties": { "two": { "type": "string" } } },
                ]
              }
            }
          }
        }
      }
    }
  }

Your Environment

  • Version used: 4.3.7
  • Environment name and version: Chrome 134
  • Operating System and version (desktop or mobile): Either
  • Link to your project:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions