Nexmo / oas_parser

An open source Open API Spec 3 Definition Parser
MIT License
51 stars 16 forks source link

Response schema does not support strings #16

Closed lornajane closed 5 years ago

lornajane commented 5 years ago

In an OpenAPI spec, none of the fields in a response is required. This parser requires that within a response, the schema key is required and within that schema key the type can only be "array" or "object" - where as many other types are supported.

Example of what I wanted to write:

      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type:  string
              example: "success"

This is valid in OpenAPI spec but causes this parser to error. It should also be possible to omit the schema tag completely.

mheap commented 5 years ago

Resolved in https://github.com/Nexmo/oas_parser/commit/168c3f74e228e1688cca86cd31f45680c4ea5fd5