You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have asked a similar question here: joelittlejohn/jsonschema2pojo#1236 and the answer was that this is the best we can do given the state of the Java URI native class.
Would it be the same here? Is the solution to implement a custom format validator, or should this be fixed in the lib?
Naïve fix:
@Override
public Optional<String> validate(String subject) {
try {
new URI(subject);
return Optional.empty();
} catch (URISyntaxException e) {
if (e.getReason().equalsIgnoreCase("expected authority")) {
return Optional.empty();
}
}
return Optional.of("Invalid URI");
}
The text was updated successfully, but these errors were encountered:
Hello, if you plan to raise a PR with a standard-compliant URI format validator then I don't mind merging it, but I don't plan to fix this issue on my own.
JSON schema string format uri uses https://tools.ietf.org/html/rfc3986 which allows an empty authority, but the java type java.net.URI uses the obsolete https://tools.ietf.org/html/rfc2396 which does not allow it. For example, android and ios discovery uris fails validation:
Schema:
Trying to validate this gives the following:
I have asked a similar question here: joelittlejohn/jsonschema2pojo#1236 and the answer was that this is the best we can do given the state of the Java URI native class.
Would it be the same here? Is the solution to implement a custom format validator, or should this be fixed in the lib?
Naïve fix:
The text was updated successfully, but these errors were encountered: