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'm having the same issue. Getting:
{
"property": "instance",
"message": "is not exactly one from "TYPE A","TYPE B""
}
when the schema is defined as "oneOf": [...]
ClementMindflow
changed the title
validation error reported onOff object incorrectly
validation error reported onOf object incorrectly
Apr 25, 2024
I came back here after a while...
The issue did not came from the validation lib but from a misunderstanding about how oneOf were supposed to work.
The spec say that the value should match one and exactly one schema in the list.
And that care should be taken when crafting schemas inside a oneOf so they are not "structurally equivalent".
Which is not the case here.
Hello !
When validating a schema containing a
onOf
where two of the items are similar, an error is reported even if the value match the expected format.For example, validating the value
{ type: "json", value: "{\n \n}" }
against this schema:report the following error:
is not exactly one from <#/definitions/schema-A>,<#/definitions/schema-B>
See this codepen for a reproduction scenario.
The text was updated successfully, but these errors were encountered: