Skip to content

Providing examples for some response status codes stops automatic example generation for other status codes #2272

@fourls

Description

@fourls

For an operation with a responses section where some response Media Type Objects have an example or examples property, and some don't, i.e. like the following:

responses:
  "200":
    content:
      application/json:
        schema:
          // ...
        example:
          // <example that should be shown for 200>
  "400":
    content:
      application/json:
        schema:
          example:
            // <example that should be shown for 400>

the documentation doesn't show generated examples for the response status codes without an example / examples.

The API documentation should show the Media Type Object example / examples if present, and fall back to a generated example that uses the schema example / examples. It currently does this fallback if none of the response Media Type Objects have an example or examples, but it would ideally also do this separately for each response status code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions