Comments (5)
@ahochsteger there is no flag available for this.
I just added this information with d3bf053
from jsonschema.
@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.
@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.
@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.
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)
- Link in README for YAML playground example is broken HOT 1
- Issue with custom Regex Library HOT 10
- `Compiler.AddResource` for adding pre-compiled schemas HOT 6
- Feature: Adding Context to Validate Method HOT 2
- implementing json.Marshaler interface HOT 9
- Create JSONSchema from Compile()'s result HOT 2
- Wrong unevaluatedProperties validation errors HOT 6
- compiler.go bug in 171
- Invalid JSON schema does not error out HOT 2
- [bug] Not reading from stdin HOT 2
- Error messages are revealing absolute file paths HOT 1
- YouValidateMe JSON Schema library server project built on this library
- ECMA-262 as the default regex in this library? HOT 1
- jsonschema.Compiler has no field or method CompileRegex HOT 7
- Question: parsing Schema to string HOT 1
- error is missing instanceLocation HOT 1
- Cannot install older version than `@latest` HOT 3
- The latest release doesn't build HOT 2
- Extended the implementation of a new custom validation traversal logic(I'm not sure if there are any other side effects of this)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonschema.