-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
OneOfValidator give incorrect message when the wrong json element is not the first one in the list #470
Comments
This has been fixed in the following ticket. I will release a new version today or tomorrow. Thanks for raising it. |
The latest code for issue #456 does not fix this issue. The root cause of this issue is that the OneOfValidator reports multiple errors from each schema in the oneOf list. The SchemaValidator in light-rest-j4/openapi-validator only picks the first error in the error list as the validation response. So depending on the order in the oneOf list, the error response can be misleading. |
@jsu216 Thanks a lot for the fix. I have released 1.0.63 and the release note can be found at https://github.com/networknt/json-schema-validator/releases/tag/1.0.63 |
Thanks @stevehu, Do you know when is the next light-4j release going to be built with this 1.0.63 json-schema-validator? The latest one is still with 1.0.49. |
I will release 1.6.x before the end of the month with the dependency update. Thanks. |
Since version
1.0.46
, we found that if the invalid json is not the first in theoneOf
choice list, the error message is not right.For an example, if the schema is like below:
The
SearchByPartialName
's definition is like below:If the json message has
partialName
exceeds 70 chars like below:The error message is wrong:
Schema Validation Error - requestBody.search.byPartialName: is not defined in the schema and the schema does not allow additional properties
However, if
SearchByPartialName
is the first in theoneOf
list. the error message becomes correct.Schema Validation Error - requestBody.search.byPartialName.partialName: may only be 70 characters long
The text was updated successfully, but these errors were encountered: