openapi-parser icon indicating copy to clipboard operation
openapi-parser copied to clipboard

Empty response body

Open denouche opened this issue 6 years ago • 0 comments

Hello,

On empty response body, the content should not be present, as specified in the section Empty Response Body of https://swagger.io/docs/specification/describing-responses/

For now, the generated schema is:

...
paths:
  /foo:
    post:
      description: foo
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Foo'
          description: foo
        "204":
          content: {}
          description: No response body
...

and should be:

...
paths:
  /foo:
    post:
      description: foo
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Foo'
          description: foo
        "204":
          description: No response body
...

denouche avatar Feb 28 '18 14:02 denouche