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
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">,)
Use case description.
Inside my schema yaml file I've specified that response from some URL handler would be an array of objects, e.g.:
I've also described what is ResourceRecord inside the same yaml file
For some reason the code returns an object, not an array
in this case the exception message from OpenAPI framework is a bit strange:
id from error is the 1st attribute of my object (specified in yaml spec)
What is expected.
The expected error message is to complain that no array specified, array is missed, etc
The text was updated successfully, but these errors were encountered: