Giter Club home page Giter Club logo

Comments (3)

sirosen avatar sirosen commented on June 25, 2024

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'

  1. /tmp/inventory.json is the instance being checked.
  2. :: is a delimiter
  3. $ is the JSON Path within the instance to the failing component. $ in JSON Path means "the root of the document"
  4. : is another delimiter
  5. The rest of this is the message from the validation library, unmodified
    a. '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.

from check-jsonschema.

cidrbl0ck avatar cidrbl0ck commented on June 25, 2024

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.

from check-jsonschema.

sirosen avatar sirosen commented on June 25, 2024

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)

from check-jsonschema.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.