-
-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Description
Consider the following example schema fragment.
{
"components": {
"schemas": {
"ErrorModel": {
"type": "object",
"required": [
"message",
"code"
],
"properties": {
"message": {
"type": "string"
},
"code": {
"type": "integer",
"minimum": 100,
"maximum": 600
}
}
},
"ExtendedErrorModel": {
"allOf": [
{
"$ref": "#/components/schemas/ErrorModel"
},
{
"type": "object",
"required": [
"rootCause"
],
"properties": {
"rootCause": {
"type": "string"
}
}
}
]
}
}
}
}
Parsing the ExtendedErrorModel will fail. This is because the SchemaFactory will check for a type even though this property is not required when using inheritance.
def create(self, schema_spec):
schema_deref = self.dereferencer.dereference(schema_spec)
schema_type = schema_deref['type']
.....
Metadata
Metadata
Assignees
Labels
No labels