Skip to content

Does not handle empty response case #122

@ccouzens

Description

@ccouzens

From the swagger documentation:

Some responses, such as 204 No Content, have no body. To indicate the response body is empty, do not specify a content for the response:

https://swagger.io/docs/specification/describing-responses/#empty

If you try and test such an endpoint with apivore, you get the following exception:

Swagger doc: /swagger.json missing response model for get request with /liveness for code 200

It looks like the validator code https://github.com/westfieldlabs/apivore/blob/master/lib/apivore/validator.rb#L83 should be checking to see if response body is null before raising an exception about missing response models

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