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
{{ message }}
Repository navigation
Response schema validation message is not clear for arrays #128
Hello!
I have a similar issue, but it occurs only on the newest version of openapi-core (0.13.3). I can't seem to validate any array of objects. Currently I must stick to the 0.12.0, which works perfectly but DOES NOT show errors (when a test fails) which is a bit problematic.
I would like to know if there is any horizon to fix this bug or maybe a workaround exists?
I remember that versions between 0.12.0 and 0.13.3 did not work for me neither (I can reinstall them and detail the information if needed, but first I wanted to focus on the most recent 0.13.3).
Use case description.
The object I'm trying to validate is defined as follows:
I had also tried removing the allOf and merging all into one object, but it did not help.
What is expected.
The object is validated correctly, just like in 0.12 and previous versions.
What is obtained
The error I get when trying to validate my array of objects says that "your array is not of type object".
openapi_core.unmarshalling.schemas.exceptions.InvalidSchemaValue: Value {'data': [{'truck_group_id': 1, 'name': 'default', 'truck_ids': [1, 3, 4, 2], 'description': None, 'last_modified': '2020-04-20T17:56:55.820577+02:00'}]} not valid for schema of type SchemaType.OBJECT: (<ValidationError: "[{'truck_group_id': 1, 'name': 'default', 'truck_ids': [1, 3, 4, 2], 'description': None, 'last_modified': '2020-04-20T17:56:55.820577+02:00'}] is not of type object">,)
Activity
michalmiesiak commentedon Apr 20, 2020
Hello!
I have a similar issue, but it occurs only on the newest version of
openapi-core(0.13.3). I can't seem to validate any array of objects. Currently I must stick to the0.12.0, which works perfectly but DOES NOT show errors (when a test fails) which is a bit problematic.I would like to know if there is any horizon to fix this bug or maybe a workaround exists?
I remember that versions between
0.12.0and0.13.3did not work for me neither (I can reinstall them and detail the information if needed, but first I wanted to focus on the most recent0.13.3).Use case description.
The object I'm trying to validate is defined as follows:
And then:
And finally:
I had also tried removing the
allOfand merging all into one object, but it did not help.What is expected.
The object is validated correctly, just like in 0.12 and previous versions.
What is obtained
The error I get when trying to validate my array of objects says that "your array is not of type object".
openapi_core.unmarshalling.schemas.exceptions.InvalidSchemaValue: Value {'data': [{'truck_group_id': 1, 'name': 'default', 'truck_ids': [1, 3, 4, 2], 'description': None, 'last_modified': '2020-04-20T17:56:55.820577+02:00'}]} not valid for schema of type SchemaType.OBJECT: (<ValidationError: "[{'truck_group_id': 1, 'name': 'default', 'truck_ids': [1, 3, 4, 2], 'description': None, 'last_modified': '2020-04-20T17:56:55.820577+02:00'}] is not of type object">,)I would be glad for any help! 🙏