This project implemented JSON schema draft 2019-09 (draft-08).
- Doesn't support meta-shema, '$schema' and '$vocabulary'
- Doesn't support collecting annotations, applicator 'unevaluatedProperties' and 'unevaluatedItems'
- Doesn't support vocabulary for the contents of string-encoding data
- Doesn't support vocabulary for basic meta-data annotations
- You must use the normalized URL, this implementation will NOT normalize it for you
- 'format' is assertion ONLY, you can register your own format to add new (or replace default) handler
- Supported output format: Flag (with the error location: keywordLocation, instanceLocation and absoluteKeywordLocation)
- Only a few formats are suppored. see 'init.go' for details.
- The default URL of schema is 'https://default.uri' if you do not have $id field in root schema.
- This implementation treats 0 as integer, 0.0 as float64, and 0 != 0.0
- Support http, https and file protocols to reference external schema. The host of file protocol URL must be 'localhost', '127.0.0.1' or empty string ''. You can also register your own schema resolver, see the example in file 'schema_test.go'.
tpl := "{\"type\": \"object\"}"
target := "{\"abc\":1}"
s := schema8.Parse([]byte(tpl), "")
if ret := schema.Match([]byte(target)); ret.Err != nil {
return fmt.Errorf("schema.Match failed. Result is %s", ret)
}