Closed TF88641 closed 1 month ago
Yes it is no longer directly possible. The uri cache is held in the factory and late or contradictionary mappings would be confusing when it doesn't take.
You can always create an instance of a custom schema mapper and hold its reference to add your mappings late if you want.
I'm trying to upgrade from 1.0.x to 1.3.3
Previously I would obtain a JsonSchemaFactory and then do something like
jsonSchemaFactory.getSchema(schemaURI, additionalConfig);
The useful thing here was I leveraged the config ability to customise URI translation like so
config.addUriTranslator(URITranslator.map("http://some.host.com:80/request.json", "resource:/schema/request.json"));
Yes I see in the docs URITranslator is moved to SchemaMapper, but the key point is by the looks of it we can't set the mapping up in config and pass it in on the fly -correct? Instead it seems I have to know in advance and customise before calling build() method of JsonSchemaFactory .because SchemaValidatorsConfig has nothing like
config.addSchemaMapper( schemaMapper );
Unless I'm missing something?