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
We noticed that some developers forgot to declare types in our schemas, and as a result validating responses against those schemas doesn't behave as strictly as we would like.
Here's an example:
>>> from flex.core import validate
>>> schema
{'additionalProperties': False, 'properties': {'name': {'type': 'string'}}}
>>> data = 0
>>> validate(schema, data)
I forgot to add type: object here for the schema. Now, any data of any type can pass validation against this schema.
I'm not sure if this is a bug or not. I'd prefer flex to raise an error here, since it can't know how to validate data without a type. But maybe OAS allows undeclared types? I tried looking through the specification and didn't come up with anything. What do you think?
We noticed that some developers forgot to declare
type
s in our schemas, and as a result validating responses against those schemas doesn't behave as strictly as we would like.Here's an example:
I forgot to add
type: object
here for the schema. Now, any data of any type can pass validation against this schema.I'm not sure if this is a bug or not. I'd prefer flex to raise an error here, since it can't know how to validate data without a type. But maybe OAS allows undeclared types? I tried looking through the specification and didn't come up with anything. What do you think?
Here's a picture of cute anteaters.
The text was updated successfully, but these errors were encountered: