jsonschema
jsonschema copied to clipboard
JSONSchema (draft 2020-12, draft 2019-09, draft-7, draft-6, draft-4) Validation using Go
Resolves issue #77 by checking the status of `big.Rat`'s `SetString` method when dealing with numbers. I was uncertain of what the field should be (the first param in `validationError`) so...
```go package main import ( "encoding/json" "log" "github.com/santhosh-tekuri/jsonschema/v5" ) func main() { schema := `{"type": "integer"}` instance := json.Number("abc") sch, err := jsonschema.CompileString("schema.json", schema) if err != nil { log.Fatalf("%#v",...
Note that for the time being, these formats apply not only to integer types, but numbers too. https://github.com/OAI/OpenAPI-Specification/blob/3.1.0/versions/3.1.0.md#dataTypes Refs https://github.com/santhosh-tekuri/jsonschema/issues/75
OpenAPI defines some additional formats over the JSON schema validation spec: https://github.com/OAI/OpenAPI-Specification/blob/3.1.0/versions/3.1.0.md#dataTypes Would there be interest in adding support for those `int32`/`int64`/`float`/`double` formats ones built in in this project? I...
I'm trying to define a keyword to validate uri-reference (e.g. for "data/client.json" make sure that client.json file exists and it is a valid json schema. Current context for user-defined keyword...
I've just come across this and it's working great :) However, one thing I've noticed that's a bit awkward is - any errors caused by a violation of a `required`...
I'm trying to create a meta-schema and later on validate the schema with that meta-schema. However, when : ``` "$schema": "some_non_draft_ url" ``` It breaks. I checked that the URL...
The goal is to make it clearer what bits do what and how it all goes together, so a user can more quickly get started with custom keywords.
I'm trying to figure out how `jsonschema.ValidationError` are to be translated to something understandable to an end user, or for that matter looped to for example mark input fields for...
Since regular expressions used [in JSON schema](http://json-schema.org/understanding-json-schema/reference/regular_expressions.html) docs aren't restricted to the [RE2 syntax](https://github.com/google/re2/wiki/Syntax), it would be ideal if the validator could be configured to use something other than the...