json_schema_compare

package module
v0.0.0-...-a900c04 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: LGPL-2.1 Imports: 5 Imported by: 1

README

json-schema-compare

Superset.json

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Schema 1 / Superset",
    "$id": "http://example.com/superset",
    "type": "object",
    "properties": {
        "country": {
            "type": "string",
            "title": "The Country"
        },
        "name": {
            "type": "string",
            "title": "The the name"
        }
    }
}

Subset.json

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Schema 1 / Subset",
    "$id": "http://example.com/subset",
    "properties": {
        "country": {
            "type": "string"
        }
    }
}

Exitcode 0: go run ./... -subset Subset.json -superset Superset.json

  • If we change the name of country in Superset.json to area:
$ go run ./... -subset Subset.json -superset Superset.json
/country                                                    : field is present in subset but not in superset
$ echo $?
1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(subset *jsonschema.Schema, superset *jsonschema.Schema) validationErrors

func CompareFiles

func CompareFiles(subsetUrl string, supersetUrl string, resources map[string]string) (validationErrors, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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