python-openapi/openapi-schema-validator

OpenAPI 3.0 list of types raises TypeError not SchemaError

p1c2u opened this issue · 1 comments

p1c2u commented

Given:

{"type": ["string", "null"]}

Result:

OAS30Validator(schema).validate(12)

TypeError: unhashable type: 'list'

Expected:
It should raise SchemaError

p1c2u commented

It raises SchemaError when run with check_schema

OAS30Validator.check_schema({"type": ["string", "null"]})

Result:

SchemaError: ['string', 'null'] is not one of ['array', 'boolean', 'integer', 'null', 'number', 'object', 'string']