-
-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Labels
area/schemaIndicates an issue on schema areaIndicates an issue on schema area
Description
I've noticed that if you define a Schema using allOf, that particular schema will note marked as an object itself, even though it's based in other objects.
OAS3 States:
Composition and Inheritance (Polymorphism)
The OpenAPI Specification allows combining and extending model definitions using the allOf property of JSON Schema, in effect offering model composition. allOf takes an array of object definitions that are validated independently but together compose a single object.
It's clear that the result of a usage of an allOf statement should produce an object.
Tried with:
components:
schemas:
Error:
type: object,
properties:
message:
type: string
TS:
type: object
properties:
moment:
type: string,
format: datetime
ExtendedError:
type: object
properties:
message:
type: string
suberror:
allOf:
- $ref: '#/components/schemas/Error'
- $ref: '#/components/schemas/TS'
In this case the Schema
for suberror
have it's type
property set to SchemaType.Any
because of they way how the type is defined without checking on inheritance:
self.type = SchemaType(schema_type)
# ... REDACTED CODE ...
self.all_of = all_of and list(all_of) or []
Metadata
Metadata
Assignees
Labels
area/schemaIndicates an issue on schema areaIndicates an issue on schema area