-
Notifications
You must be signed in to change notification settings - Fork 331
urn:jsonschema:java:time:Instant is not supported as reference #100
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
Comments
The current Jackson version we are using is 2.9.5. Have you tried with it? Just trying to narrow the issue to ensure that it is the Jackson version issue. Thanks. |
It is the same with 2.9.5. It generates the same schema. It seems that RefValidator is not able to resolve the "$ref": "urn:jsonschema:java:time:Instant" using id used in the previous attribute. |
I don't think we support |
@stevehu This example actually wouldn't work with what I put together. Only standard URL schemes and the 'classpath'/'resource' schemes are supported right now (that is all configured in the constructor of JsonSchemaFactory.Builder). Custom URI schemes need to have a URIFactory and URIFetcher injected into the JsonSchemaFactory.Builder. Now that I'm looking into it more, I'm realizing that there's actually a spec for a 'urn' URI scheme (https://tools.ietf.org/html/rfc8141#section-2). I did not add support for that scheme, but it can easily be done by creating a URIFactory for it. However, users will need to supply their own URIFetcher for the 'urn' scheme because there's no standard way to fetch a URN from what I can tell. |
There is still similar problem with urn resolving (invalid segment for URI). This does not work:
This works:
The same goes regarding: public URI create(final URI baseURI, final String segment) |
Hello, I'm away from my PC, but the URLFactory isn't for URNs. A URL is a
valid URI, but a URN is not a valid URL. We should have a URNFactory, but
we don't yet have built in support for URNs. It's possible to create your
own URIFactory and URIFetcher for URNs, but they need to be injected into
the JsonSchemaFactory.
…On Sun, Sep 15, 2019, 11:16 PM Matej Spiller Muys ***@***.***> wrote:
There is still similar problem with urn resolving (*invalid segment for
URI*).
URL factory: *public URI create(final String uri)*
This does not work:
return new URL(uri).toURI();
This works:
return new URI(uri);
The same goes regarding: public URI *create(final URI baseURI, final
String segment)*
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#100?email_source=notifications&email_token=AAWC3XCGFK44HJXVNO3WVTDQJ4QCHA5CNFSM4FUIN45KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6YGEIA#issuecomment-531653152>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAWC3XEXCRA3RC3XWG7X663QJ4QCHANCNFSM4FUIN45A>
.
|
@francesc79 Thanks for making this issue float again. Frankly, I haven't looked at this issue for a while as I am busy with a lot of other issues. I think @jawaff is in the same situation. Would you be able to try it out and submit a PR? Personally, I don't have a preference for either solution. |
I need to use a URN in the $id to identify the schema. Since version 1.0.30 this is not working anymore. We don't want the URN to be able to be fetched (retrievable) at all (otherwise we would use a URL). In the combineCurrentUriWithIds method a JsonSchemaException is thrown. |
@Arno538 Thanks a lot for raising the issue. Given that it was working before 1.0.30, chances are some updates in 1.0.30 broke the feature. Would you be able to compare the code base and find out the root cause and get it fixed? Thanks. |
I think this issue is resolved in the latest version. If not, let's reopen this issue to address it. Thanks. |
Uh oh!
There was an error while loading. Please reload this page.
There is error when validating using schema generated by jackson 2.9.6:
CODE:
POJO:
SCHEMA:
ERROR:
The text was updated successfully, but these errors were encountered: