Closed goncalonsp closed 4 years ago
@goncalonsp
Thank you for using this small library.
I believe http:/john.acme.com
is a valid absolute URI.
If checking with java.net.URI
:
URI url = URI.create("http:/john.acme.com");
System.out.println(url.isAbsolute());
The RFC 3986 states:
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
hier-part = "//" authority path-abempty
/ path-absolute
/ path-rootless
/ path-empty
Here path-absolute
starts with a single /
.
path-absolute = "/" [ segment-nz *( "/" segment ) ]
Justify checks whether the given string is a valid URI or not based on the RFC 3986. It does not check any scheme-specific constraints, such as the constraints of http URL. This behavior is the same as java.net.URI class.
Thank you for your swift response! I will close this issue.
I've encountered an issue while validating
uri
formatted properties. As it seems, no validation is done whatsoever. Is this an expected behavior?Check the following repo reproducing the error (simply run the App.java class): https://github.com/goncalonsp/justify-uri-validation-issue
In summary the schema is:
and the object being validated:
Where
http:/john.acme.com
is invalid and should behttp://jonh.acme.com
instead.