GithubHelp home page GithubHelp logo

Comments (5)

santhosh-tekuri avatar santhosh-tekuri commented on June 30, 2024

@ahochsteger there is no flag available for this.
I just added this information with d3bf053

from jsonschema.

ahochsteger avatar ahochsteger commented on June 30, 2024

@santhosh-tekuri wow, that was quick - thanks a lot! 😃
Since I use it as part of an build pipeline with automated reporting it would be great to have the instance as part of the JSON output. Currently it breaks the processing, since the output is now mixed plain text and JSON.

It also seems, that currently the output JSON switches from stdout to stderr if validation errors are found, which makes post-processing a pain, since I have to redirect stderr to stdout (2>&1) which may still break if there are any non-JSON error messages which should stay at stderr. Best would be if JSON would always be in stderr and additional (text) messages always to stderr.

Let me know, if you think I should open a separate issue for that.

from jsonschema.

santhosh-tekuri avatar santhosh-tekuri commented on June 30, 2024

@ahochsteger
I am rewriting this package. You can find the latest one at:
https://github.com/santhosh-tekuri/jsonschema/blob/boon/cmd/jv/main.go

it has more consistent output and also has -q quite mode

it has better output for parsing.

You can try the latest one if possible. otherwise let me know if adding -q quite flag solves your trouble

from jsonschema.

ahochsteger avatar ahochsteger commented on June 30, 2024

@santhosh-tekuri I just tried the boon branch, but it gives me this error:

$ go install github.com/santhosh-tekuri/jsonschema/cmd/jv@boon
go: downloading github.com/santhosh-tekuri/jsonschema/v6 v6.0.0
../../../../go/pkg/mod/github.com/santhosh-tekuri/jsonschema/cmd/[email protected]/loader.go:13:2: reading github.com/santhosh-tekuri/jsonschema/go.mod at revision v6.0.0: unknown revision v6.0.0

from jsonschema.

santhosh-tekuri avatar santhosh-tekuri commented on June 30, 2024

the branch boon is not published yet. so go install will not work.

you have to clone the repo and build it from sources as shown below:

$ git clone https://github.com/santhosh-tekuri/jsonschema.git
Cloning into 'jsonschema'...
remote: Enumerating objects: 3960, done.
remote: Counting objects: 100% (1737/1737), done.
remote: Compressing objects: 100% (589/589), done.
remote: Total 3960 (delta 1178), reused 1285 (delta 1113), pack-reused 2223
Receiving objects: 100% (3960/3960), 872.06 KiB | 1.19 MiB/s, done.
Resolving deltas: 100% (2821/2821), done.

$ cd jsonschema
$ git checkout boon
branch 'boon' set up to track 'origin/boon'.
Switched to a new branch 'boon'
$ go build ./cmd/jv
$ ./jv -h
Usage: jv [OPTIONS] SCHEMA [INSTANCE...]

Options:
  -c    Enable content assertions with draft >= 7
  -cacert PEM-certificate-file
        Use the specified PEM-certificate-file to verify the peer. The file may contain multiple CA certificates
  -d version
        Draft version used when '$schema' is missing. Valid values 4, 6, 7, 2019, 2020 (default 2020)
  -f    Enable format assertions with draft >= 2019
  -h    Print help information
  -k    Use insecure TLS connection
  -o format
        Output format. Valid values simple, alt, flag, basic, detailed (default "simple")
  -q    Do not print errors

NOTE: the command line flags are bit different compared to original

from 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.