Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Case of multiple mandatory fields are missing , names of the missing properties is not displayed #456

Open
meetniyazi opened this issue Apr 27, 2022 · 4 comments

Comments

@meetniyazi
Copy link

In Case of multiple mandatory fields are missing , names of the missing properties is not displayed.

For the example two mandatory properties are missing in the json input , but at the time of the validation following error is getting displayed. Is it possible which all mandatory fields are missing along with their name.

"rg.everit.json.schema.ValidationException: #: 2 schema violations found"

Thanks For the help

@erosb
Copy link
Contributor

erosb commented Apr 27, 2022

Hello, please look into ValidationException#getCausingExceptions().

@DominikSarnowski
Copy link

DominikSarnowski commented Jul 19, 2022

Hello, I will use this case to ask about similar thing:

I'm using the causingExceptions but when it is required type of violation the pointerToViolation is wrong.
Should be "partyType" in my case (as in the detailsMessage stated).
Is there any chance to fix this ? I hate parsing strings to get data that can be retrieved simplier way :)

image

@erosb
Copy link
Contributor

erosb commented Jul 22, 2022

The "required" keyword sets a constraint on the containing object and not the property itself, so the pointer is ok. The pointers should not reference nonexistent data (which would be the case if it would point to the missing property).

I know that it isn't very good to parse the exception message to get the missing property name. This problem may be addressed in the future, but there is no ETA.

@DominikSarnowski
Copy link

It would be great if there would be some common place where we could find fieldName causing the issue, all the more there is such information available.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants