Closed JeelRajodiya closed 4 months ago
You get the FLAG output format by default. This format only contains information about whether the validation succeeded or failed. You need to use the BASIC output format to get details about what failed. Previously, the FLAG format was returning some properties that aren't part of the FLAG format. I removed that in the latest release because they don't provide any useful information anyway.
Documentation on how to set the output format is in the README
Oh, Thanks! It is returning the errors now.
I have was able to produce the errors for the data. But I also wish to produce the errors for the schema itself. as you have mentioned I have set the output format to BASIC
. please see the code below
I am trying to get errors for the schema as well. for example if the user sets the type
to stringg
(which is invalid). I want to point that it is invalid. currently as per my code above hyperjump is throwing InvalidSchemaError: Invalid Schema
. Which does not contain the information why the schema is invalid (please see the screenshot below)
Sorry, if I have missed something from the docs. But Is there any option which can give some information about why the schema is invalid? (in this case stingg
is not a valid type)
InvalidSchemaError
has a property called "output" that contains the validation results you're looking for. See the "Change the schema validation output format" section in the Output Formats documentation for an example.
Thank you
Output object in version 1.7.3
Output Object in version 1.9.2
I am trying to get the error messages in both the
data validation
andschema validation
. but after upgrading these field seems to be disappeared. Is there any option I should pass to the validation function to get those error messages?Code for hyperjump
Data
Schema