You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Schemas defined by allOf are not treated as Objects #147
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.
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_ofandlist(all_of) or []
Activity
phrfpeixoto commentedon Jul 7, 2019
As a work around, you may add a type declaration alongside that allOf
phrfpeixoto commentedon Jul 14, 2019
@p1c2u Would you mind reviewing this?
p1c2u commentedon Sep 7, 2019
It's said they both compose a single object. Object here is meant by object definition and not object type
Take a look at the following example:
phrfpeixoto commentedon Sep 8, 2019
That's exactly what I'm reporting. The code only treats the resulting object as such if you specify the
type