java-json-tools/json-schema-core

Schema redirect - opaque URI strange check - URIUtils

regfaker opened this issue · 0 comments

URIUtils schema URI checker used for URITranslatorConfigurationBuilder.addSchemaRedirect() checks path of URI not ending with slash.

BUNDLE.checkArgumentPrintf(!argument.getPath().endsWith("/"),

This is problem for opaque URI (e.g. URN) where there is no path and such call throws NullPointerException.
This path check seems unnecessary as normalization use only scheme, scheme specific part and fragment of URI (not path).
return new URI(uri.getScheme(), uri.getSchemeSpecificPart(),

Please verify check and normalization correlation. Or maybe just NPE aid will do the thing.
Thanks