-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Description
Hi there,
I am unsure of how to interpret this v3.0.0 specification and would appreciate expert guidance.
Given this spec:
ShapeInterface:
properties:
shapeType:
type: string
required:
- shapeType
TriangleInterface:
properties:
triangleType:
type: string
required:
- triangleType
IsoscelesTriangle:
allOf:
- $ref: '#/components/schemas/ShapeInterface'
- $ref: '#/components/schemas/TriangleInterface'
additionalProperties: false
additionalProperties is True by default in ShapeInterface + TriangleInterface
but we set it to False in IsoscelesTriangle
Some questions:
- Is this a valid spec?
- Will validating this payload as an IsoscelesTriangle succeed?
{
'shape_type': 'Triangle',
'triangle_type': 'EquilateralTriangle',
'unknown_property': 'a-value'
}
- If validation will not succeed then this also has implications to validating oneOf/anyOf composed schemas, right? First one would need to validate to all oneOf/anyOf schemas, then if additionalProperties is False at the composed schema level only, one would need to check that all the assigned properties exist as properties in the chosen oneOf/anyOf schemas.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels