validator-go-jsonschema

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: Apache-2.0

README

Json Schema using Brzozowski's derivatives

JSON Schema in Go using Katydid underlying algorithm. This project translates JSON Schema to a regular hedge grammar and then executes validation via Katydid's validator-go.

Usage Example

	schemaBytes := []byte(`
    { "title": "small jsonschema for a blogpost",
      "type":"object", "additionalProperties":false, "required": ["content"],
      "properties": {
        "content": { "type":"string" },
        "author": { "$ref":"#/definitions/user-profile" } },
      "definitions": { "user-profile": {
        "type": "object", "additionalProperties":false, "required": ["username"], 
        "properties": {
          "username": { "type":"string" },
          "email": { "type":"string", "format":"email" } } } } }`)
	compiled, err := Compile(schemaBytes)
	...
	input := []byte(`{"content": "Dragons", "author": {"username": "Khaleesi"}}`)
	matched, err := compiled.MatchBytes(input)
	...

Test Suites passed

  • Draft4 (excluding uniqueItems and remoteRef)

Unsupported

Directories

Path Synopsis
std
translate/jsonpointer
Package jsonpointer implements IETF rfc6901 JSON Pointers are a string syntax for identifying a specific value within a JavaScript Object Notation (JSON) document [RFC4627].
Package jsonpointer implements IETF rfc6901 JSON Pointers are a string syntax for identifying a specific value within a JavaScript Object Notation (JSON) document [RFC4627].

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL