Skip to content

Compose all component types, not just schemas #2936

@k98kurz

Description

@k98kurz

The current state of affairs is that responses can be defined as components and referenced with the "$ref":"{uri}" syntax, but these cannot be composed using the allOf directive. Trying to do so results in an error. Adding sibling properties also results in an error. So there is currently no way to define a response with a general schema and then add endpoint-specific models or examples. This seems like a gross oversight and major limitation.

For example, let's say that there are multiple endpoints that return lists of models following a standard response format, but each endpoint returns different models. It would be ideal to keep the reusable format of the response in a response component and compose it with the specific model under the path definition.

Without this functionality, the only options are to have invalid documents or abandon the use of response components.

Metadata

Metadata

Assignees

No one assigned

    Labels

    re-use: ref-group-combineRe-use requests involving grouping components and combining groups

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions