Skip to content

additionalProperties: false causes composed schema to be dropped #1227

@jwulf

Description

@jwulf

Describe the bug

When generating API docs, with a schema that has an allOf with a $ref and inline properties, adding additionalProperties: false to the parent causes the $ref schema to be omitted in the output.

Expected behavior

The $ref schema in the allOf should be composed and appear in the documentation output.

Current behavior

The $ref is omitted in output.

Possible solution

Steps to reproduce

With a schema like this:

ProcessInstanceSearchQuery:
    description: "Process instance search request."
    type: "object"
    additionalProperties: false
    allOf:
      - $ref: "#/components/schemas/SearchQueryRequest"
    properties:
      sort:
        description: "Sort field criteria."
        type: "array"
        items:
          $ref: "#/components/schemas/ProcessInstanceSearchQuerySortRequest"
      filter:
        description: "The process instance search filters."
        allOf:
          - $ref: "#/components/schemas/ProcessInstanceFilter"

Adding additionalProperties: false causes the SearchQueryRequest schema to disappear in output.

Same thing when modelled like this:

ProcessInstanceSearchQuery:
    description: "Process instance search request."
    type: "object"
    additionalProperties: false
    allOf:
      - $ref: "#/components/schemas/SearchQueryRequest"
      - type: "object"
         properties:
             sort:
                description: "Sort field criteria."
                type: "array"
             items:
                $ref: "#/components/schemas/ProcessInstanceSearchQuerySortRequest"
              filter:
                 description: "The process instance search filters."
                 allOf:
                    - $ref: "#/components/schemas/ProcessInstanceFilter"

Screenshots

Image Image

Context

Your Environment

  • Version used:
    • "docusaurus-plugin-openapi-docs": "^4.4.0",
    • "docusaurus-theme-openapi-docs": "^4.4.0",
  • Link to your project: https://docs.camunda.io

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