Is there a way to use the errorMessage from the schema when validation fails? #573
-
Hello, I am currently using JSONCONS in C++ for validating JSON against a schema. I was wondering if there's a way to extract the 'errorMessage' directly when a JSON schema validation fails. In my use case, I have a JSON schema with specific validation rules and I want to provide informative error messages to the end users when their JSON fails to validate against the schema. I noticed that there are 'errorMessage' annotations in the JSON schema draft-07, which allow for custom error messages. My question is, does JSONCONS support these 'errorMessage' annotations and if so, how can I extract these custom error messages when a validation error occurs? Any guidance on this would be greatly appreciated. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
Apologies, I misunderstood the question. No, we currently don't keep the 'errorMessage' property, but we'll look into adding that in the next release.