-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema validation #38
Comments
Please send a PR with a failing test as it is described in the contributing guidelines |
Hi I'am sorry but fork was not imported correctly into IntelliJ and i am very short on time, so i created a gist https://gist.github.com/romanpa/0ee3437f59f634821d8c03af2eaf69d3 Regards, |
erosb
added a commit
to erosb/everit-json-schema
that referenced
this issue
Jul 17, 2016
I've spent quite some time on examining this issue, and I found the followings:
|
Thanks |
erosb
added a commit
that referenced
this issue
Jan 22, 2019
Reference: section 8.3.1 of json schema core draft-7 says: "Such URIs and schemas can be supplied to an implementation prior to processing instances" So here if the caller associates a raw schema to an URI using `SchemaLoaderBuilder#registerSchemaByURI()` then the loader will recognize this URI and load the associated raw schema without hitting the network or any external protocols. This was originally requested in #38.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
The schema below should catch an error in an object below.
But id does not :(
Map schemaMap = getSchemaMap();
JSONObject rawSchema = new JSONObject(schemaMap);
Schema schema = SchemaLoader.load(rawSchema);
schema.validate(....)
{
"type" : "object",
"id" : "urn:jsonschema:com:zzzzz:tests:commons:jsonschema:models:Person",
"properties" : {
"book" : {
"type" : "object",
"id" : "urn:jsonschema:com:zzzzz:tests:commons:jsonschema:models:PhoneBook",
"properties" : {
"numbers" : {
"type" : "array",
"items" : {
"type" : "object",
"id" : "urn:jsonschema:com:zzzzz:tests:commons:jsonschema:models:PhoneNumber",
"properties" : {
"number" : {
"type" : "string",
"pattern" : "+?\d+"
},
"type" : {
"type" : "string"
}
}
}
}
}
},
"phoneBooks" : {
"type" : "array",
"items" : {
"type" : "object",
"$ref" : "urn:jsonschema:com:zzzzz:tests:commons:jsonschema:models:PhoneBook"
}
}
}
}
{
"book" : {
"numbers" : [ {
"number" : "22222"
}, {
"number" : "11111"
} ]
},
"phoneBooks" : [ {
"numbers" : [ {
"number" : "22222"
}, {
"number" : "11111"
}, {
"number" : "aaaaa"
} ]
} ]
}
The text was updated successfully, but these errors were encountered: