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
I use the OpenAPI's discriminator property in my JSON schemas and I get the following error when compiling schemas:
ERROR Error: [discriminator]: need propertyName, oneOf OR anyOf at ConfigBase#
It seems that your discriminator property checking does not cover all valid options. Is there any option to disable the "discriminator" property checking/handling?
This may not relate to your problem, but I wanted to note that OpenAPI 3.0.x does not match JSON Schema exactly and you must first convert it using e.g. openapi-schema-to-json-schema. You must also use the draft04 JSON Schema spec.
Is there any option to disable the "discriminator" property checking/handling?
The problem is that the behavior of discriminator is underspecified, and outside the strict subset mentioned above, that behavior is non-obvious.
Disabling coherence checks on schema could lead to unexpected and/or unspecified behavior.
More specifically: in the schema given above, the behavior apparently expected from the allOf usage contradicts the upstream JSON Schema spec. It should have been anyOf or oneOf.
As a rule of thumb, everything that passes with discriminator should also pass without it, which is something this schema does not follow.
Covering underspecified or contradictory cases of discriminator is not planned.
I use the OpenAPI's discriminator property in my JSON schemas and I get the following error when compiling schemas:
ERROR Error: [discriminator]: need propertyName, oneOf OR anyOf at ConfigBase#
It seems that your discriminator property checking does not cover all valid options. Is there any option to disable the "discriminator" property checking/handling?
JSON schemas:
"Base" : { "type" : "object", "properties" : { "description" : { "type" : "string", }, "dp" : { "type" : "string", } }, "discriminator" : { "propertyName" : "dp" } },
"IndividualBase" : { "type" : "object", "allOf" : [ { "$ref" : "Base#" }, { "type" : "object", "properties" : { "key" : { "type" : "string", } } } ] },
The text was updated successfully, but these errors were encountered: