Closed
Description
Hi. I am trying to validate a response which is an array of objects and this case does not work properly.
spec:
paths:
/one_of:
get:
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Cont'
components:
schemas:
Cont:
type: array
items:
oneOf:
- $ref: '#/components/schemas/Obj1'
- $ref: '#/components/schemas/Obj2'
Obj1:
type: object
properties:
a:
type: string
Obj2:
type: object
properties:
b:
type: string
If response is [{'a': '1'}, {'c': '2'}] - validator does not raise SchemaValidationError.
Expecting that {'c': '2'} is rejected.
openapi_core-0.7.1
openapi_spec_validator-0.2.4