You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a param has a format, the formatter will coerce the value to that type instead of failing when validate_requests is enabled.
Pet Store example using bravado - petId has an int64 format:
petstore_json=requests.get('http://petstore.swagger.io/v2/swagger.json').json()
c=bravado.client.SwaggerClient.from_spec(spec_dict=petstore_json)
c.pet.getPetById(petId="123") # the string is coerced to a longpetstore_json['paths']['/pet/{petId}']['get']['parameters'][0].pop('format')
c=bravado.client.SwaggerClient.from_spec(spec_dict=petstore_json)
c.pet.getPetById(petId="123") # fails with ValidationError
This seems like a pretty serious issue as it causes unexpected behavior. At the very least, we should document it. I'm not entirely sure how we could fix this behavior at this point without breaking pretty much everyone.
When a param has a
format
, the formatter will coerce the value to that type instead of failing when validate_requests is enabled.Pet Store example using bravado -
petId
has anint64
format:This seems like a pretty serious issue as it causes unexpected behavior. At the very least, we should document it. I'm not entirely sure how we could fix this behavior at this point without breaking pretty much everyone.
Pinging the usual suspects: @sjaensch @macisamuele @analogue @jnb
The text was updated successfully, but these errors were encountered: