Yelp / bravado-core

Other
109 stars 98 forks source link

bravado-core assumes that response body is present if a body parameter is defined #321

Closed macisamuele closed 5 years ago

macisamuele commented 5 years ago

Currently, if an endpoint does define a body parameter then bravado-core reads the content of the body and throws a SwaggerMappingError if the body is not valid json.

But, if the body parameter is optional then the body won't be present and so the exception will be thrown, which basically forces the body to be defined even if the parameter is optional.

https://github.com/Yelp/bravado-core/blob/43c8002f43e0f2f0e5caf2ead6660677431b3895/bravado_core/param.py#L185