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
JSON Schema links #80
Comments
Hello, Which version are you using? |
Hello I'm currently using version 2.0.1 |
Ah, that explains it. Syntax support, by default in 2.0.x, only covers validation, not the hyperschema. Therefore syntax checking for In 2.1.x, it is supported, although not completely: draft v3 is not supported, and draft v4 It is possible to backport this to 2.0.x, but the cost is heavy; and in any case, link generation is not supported. How much do you care about |
Thanks for the explanation. |
It is, but there is a preliminary condition to this: do you have a |
Yes I do my json schema is valid. I have declared it. |
OK, that may be part of the problem here; what is |
Here is the URL provided: http://json-schema.org/draft-04/hyper-schema# |
Hmm, OK, this can be viewed as a bug. In 2.0.x as well as in 2.1.x. In both of these versions, when an unknown Working around this will require quite some amount of code. Here is how... Step 1: define a new keyword for final Keyword links = Keyword.newBuilder("links")
.withSyntaxChecker(new SyntaxChecker()
{
@Override
public void checkSyntax(final Collection<JsonPointer> pointers,
final ProcessingReport report, final SchemaTree tree)
{
}
}).freeze(); Step 2: build a new library based on draft v4, change the // see above for "links"
final Library customLibrary = DraftV4Library.get().thaw()
.addKeyword(links).freeze(); Step 3: create a new final ValidationConfiguration cfg = ValidationConfiguration.newBuilder()
.setDefaultLibrary("http://json-schema.org/draft-04/hyper-schema#", customLibrary)
.build(); Step 4: build your final JsonSchemaFactory factory = JsonSchemaFactory.newBuilder()
.setValidationConfiguration(cfg).build(); You can then use this |
Closing this one. Hyper schema syntax validation (only syntax validation) will be in 2.2. |
Hi @fge, really enjoy discovering the project but i'm slightly confused: I'm am getting exactly the error described when testing on http://json-schema-validator.herokuapp.com/
|
I am using version: 2.3.8 but still getting warnings: warning: the following keywords are unknown and will be ignored: [elementName] What i did: Had the XSD, which i converted into JsonSchema, and i believe this conversion is an issue. |
Hello,
I'm using your library and i'm looking for how to deal with "links" keywords in my JSON Schema.
This links keyword is DRAFT V4 compliant, however a warning is thrown :
warning: the following keywords are unknown and will be ignored: [links]
level: "warning"
schema: {"loadingURI":"#","pointer":""}
domain: "syntax"
ignored: ["links"]
Please can anyone help?
The text was updated successfully, but these errors were encountered: