alexjomin / openapi-parser

Simple and still naive openapi documentation generator from comments of your Go code.
18 stars 8 forks source link

Empty response body #5

Open denouche opened 6 years ago

denouche commented 6 years ago

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
...