Closed cidrbl0ck closed 1 year ago
I'n entirely clueless as to what the root problem is in my schema file, however unless I'm doing it wrong I expected more information from a
-v/--verbose
This puts me in a difficult position with respect to answering your question or regarding it as resolved.
-v/--verbose
has significant impact on output in some cases, but not in others.
If schema validation encountered multiple errors, not all of them would be printed. But --verbose
enables full output of all errors.
Let me break down the error message for you a little bit to help:
/tmp/inventory.json::$: 'all', 'firewalls', 'not_set', 'routers', 'switches', 'ups', 'wlc' do not match any of the regexes: '^\w$', '_meta'
/tmp/inventory.json
is the instance being checked.::
is a delimiter$
is the JSON Path within the instance to the failing component. $
in JSON Path means "the root of the document":
is another delimiter'all', 'firewalls', 'not_set', 'routers', 'switches', 'ups', 'wlc' do not match any of the regexes
might indicate a failure to match patternProperties? I'm guessing without seeing the schema or instance
b. '^\\w$', '_meta'
these two strings are apparently regexes in your schema (again, I'm guessing patternProperties)-v
or -vv
could be made to turn on other behaviors, and I'm open to suggestions. It's only really been tuned for a couple of use-cases thusfar.
The only constraint I'll note is that I don't think we want it to reformat the existing output -- it should only add new lines of output.
Thanks @sirosen I know this is not an appropriate place to ask for help in resolving the problem with my json or schema files. I just wanted to ensure that either: A: I was invoking verbosity correctly or B: That the flag was working at is should.
Not having any prior experience using the tool makes me a poor source of suggestions for really anything potential changes. So I guess in this case, if you believe that -v
is doing what it should then my question is solved, and now I just need to dig elsewhere.
Okay, I'm going to close this. If you continue using check-jsonschema
(and I hope you do!) and have ideas later for more output that you'd like from --verbose
, feel free to circle back with a new feature request. I'm always open to ideas.
If you're looking for a place to learn more about JSON Schema, you might want to visit the community Slack, which is very active. Spec maintainers often answer questions about how to structure schemas there. There are also other validators you could try out to get another view of your schema and data. For example, there's a very cool fully in-browser one: https://json-everything.net/ (json-everything is made by one of the JSON Schema maintainers)
First time using this tool so here goes: Syntax as follows