Skip to content

Clarify response description #2863

Closed
Closed

Description

@AndreKR

It is currently unclear whether the paths.<path>.<method>.responses.<status code>.description field describes the status code or the response body and if it's the status code where to describe the response body and vice versa.

For example both of these seem to be reasonable definitions:

paths:
  /foo:
    post:
      summary: Create a new foo
      responses:
        202:
          description: The foo has been received and will be processed within one minute
          content:
            text/plain: {}
paths:
  /foo:
    post:
      summary: Create a new foo
      responses:
        202:
          description: A job token to inquire about the status of the processing of the foo
          content:
            text/plain: {}

In the OpenAPI Guide on swagger.io the Describing Responses page uses description to describe the response body, except in the section "HTTP Status Codes" where it is used to give a reason for the status code. (Unless I'm missing something and those are actually different description fields.)

Activity

  1. AndreKR commented on Jan 25, 2022

    @AndreKR
    Author

    This might be the appropriate way?

    paths:
      /foo:
        post:
          summary: Create a new foo
          responses:
            202:
              description: The foo has been received and will be processed within one minute
              content:
                text/plain:
                  schema:
                    type: string
                    description: A job token to inquire about the status of the processing of the foo
  2. locked and limited conversation to collaborators on Jan 26, 2022
  3. converted this issue into a discussion #2866 on Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions