@@ -57,7 +57,7 @@ public static class Builder {
5757 private ObjectMapper yamlMapper = null ;
5858 private JsonNodeReader jsonNodeReader = null ;
5959 private String defaultMetaSchemaIri ;
60- private final ConcurrentMap <String , JsonMetaSchema > metaSchemas = new ConcurrentHashMap <>();
60+ private final ConcurrentMap <String , Dialect > metaSchemas = new ConcurrentHashMap <>();
6161 private SchemaLoaders .Builder schemaLoadersBuilder = null ;
6262 private SchemaMappers .Builder schemaMappersBuilder = null ;
6363 private boolean enableSchemaCache = true ;
@@ -120,19 +120,19 @@ public Builder metaSchemaFactory(final JsonMetaSchemaFactory jsonMetaSchemaFacto
120120 return this ;
121121 }
122122
123- public Builder metaSchema (final JsonMetaSchema jsonMetaSchema ) {
123+ public Builder metaSchema (final Dialect jsonMetaSchema ) {
124124 this .metaSchemas .put (normalizeMetaSchemaUri (jsonMetaSchema .getIri ()), jsonMetaSchema );
125125 return this ;
126126 }
127127
128- public Builder metaSchemas (final Collection <? extends JsonMetaSchema > jsonMetaSchemas ) {
129- for (JsonMetaSchema jsonMetaSchema : jsonMetaSchemas ) {
128+ public Builder metaSchemas (final Collection <? extends Dialect > jsonMetaSchemas ) {
129+ for (Dialect jsonMetaSchema : jsonMetaSchemas ) {
130130 metaSchema (jsonMetaSchema );
131131 }
132132 return this ;
133133 }
134134
135- public Builder metaSchemas (Consumer <Map <String , JsonMetaSchema >> customizer ) {
135+ public Builder metaSchemas (Consumer <Map <String , Dialect >> customizer ) {
136136 customizer .accept (this .metaSchemas );
137137 return this ;
138138 }
@@ -159,12 +159,12 @@ public Builder schemaMappers(Consumer<SchemaMappers.Builder> schemaMappersBuilde
159159 }
160160
161161 @ Deprecated
162- public Builder addMetaSchema (final JsonMetaSchema jsonMetaSchema ) {
162+ public Builder addMetaSchema (final Dialect jsonMetaSchema ) {
163163 return metaSchema (jsonMetaSchema );
164164 }
165165
166166 @ Deprecated
167- public Builder addMetaSchemas (final Collection <? extends JsonMetaSchema > jsonMetaSchemas ) {
167+ public Builder addMetaSchemas (final Collection <? extends Dialect > jsonMetaSchemas ) {
168168 return metaSchemas (jsonMetaSchemas );
169169 }
170170
@@ -190,7 +190,7 @@ public JsonSchemaFactory build() {
190190 private final SchemaLoaders .Builder schemaLoadersBuilder ;
191191 private final SchemaMappers .Builder schemaMappersBuilder ;
192192 private final SchemaLoader schemaLoader ;
193- private final ConcurrentMap <String , JsonMetaSchema > metaSchemas ;
193+ private final ConcurrentMap <String , Dialect > metaSchemas ;
194194 private final ConcurrentMap <SchemaLocation , JsonSchema > schemaCache = new ConcurrentHashMap <>();
195195 private final boolean enableSchemaCache ;
196196 private final JsonMetaSchemaFactory metaSchemaFactory ;
@@ -205,7 +205,7 @@ private JsonSchemaFactory(
205205 String defaultMetaSchemaIri ,
206206 SchemaLoaders .Builder schemaLoadersBuilder ,
207207 SchemaMappers .Builder schemaMappersBuilder ,
208- ConcurrentMap <String , JsonMetaSchema > metaSchemas ,
208+ ConcurrentMap <String , Dialect > metaSchemas ,
209209 boolean enableSchemaCache ,
210210 JsonMetaSchemaFactory metaSchemaFactory ) {
211211 this .metaSchemas = metaSchemas ;
@@ -266,7 +266,7 @@ public static JsonSchemaFactory getInstance(Specification.Version versionFlag) {
266266 public static JsonSchemaFactory getInstance (Specification .Version versionFlag ,
267267 Consumer <JsonSchemaFactory .Builder > customizer ) {
268268 JsonSchemaVersion jsonSchemaVersion = checkVersion (versionFlag );
269- JsonMetaSchema metaSchema = jsonSchemaVersion .getInstance ();
269+ Dialect metaSchema = jsonSchemaVersion .getInstance ();
270270 JsonSchemaFactory .Builder builder = builder ().defaultMetaSchemaIri (metaSchema .getIri ())
271271 .metaSchema (metaSchema );
272272 if (customizer != null ) {
@@ -384,7 +384,7 @@ private JsonSchema doCreate(ValidationContext validationContext, SchemaLocation
384384 * @return the validation context to use
385385 */
386386 private ValidationContext withMetaSchema (ValidationContext validationContext , JsonNode schemaNode ) {
387- JsonMetaSchema metaSchema = getMetaSchema (schemaNode , validationContext .getConfig ());
387+ Dialect metaSchema = getMetaSchema (schemaNode , validationContext .getConfig ());
388388 if (metaSchema != null && !metaSchema .getIri ().equals (validationContext .getMetaSchema ().getIri ())) {
389389 SchemaValidatorsConfig config = validationContext .getConfig ();
390390 if (metaSchema .getKeywords ().containsKey ("discriminator" ) && !config .isDiscriminatorKeywordEnabled ()) {
@@ -415,7 +415,7 @@ protected SchemaLocation getSchemaLocation(SchemaLocation schemaLocation) {
415415 }
416416
417417 protected ValidationContext createValidationContext (final JsonNode schemaNode , SchemaValidatorsConfig config ) {
418- final JsonMetaSchema jsonMetaSchema = getMetaSchemaOrDefault (schemaNode , config );
418+ final Dialect jsonMetaSchema = getMetaSchemaOrDefault (schemaNode , config );
419419 SchemaValidatorsConfig configResult = config ;
420420 if (jsonMetaSchema .getKeywords ().containsKey ("discriminator" ) && !config .isDiscriminatorKeywordEnabled ()) {
421421 configResult = SchemaValidatorsConfig .builder (config )
@@ -426,17 +426,17 @@ protected ValidationContext createValidationContext(final JsonNode schemaNode, S
426426 return new ValidationContext (jsonMetaSchema , this , configResult );
427427 }
428428
429- private JsonMetaSchema getMetaSchema (final JsonNode schemaNode , SchemaValidatorsConfig config ) {
429+ private Dialect getMetaSchema (final JsonNode schemaNode , SchemaValidatorsConfig config ) {
430430 final JsonNode iriNode = schemaNode .get ("$schema" );
431431 if (iriNode != null && iriNode .isTextual ()) {
432- JsonMetaSchema result = metaSchemas .computeIfAbsent (normalizeMetaSchemaUri (iriNode .textValue ()),
432+ Dialect result = metaSchemas .computeIfAbsent (normalizeMetaSchemaUri (iriNode .textValue ()),
433433 id -> loadMetaSchema (id , config ));
434434 return result ;
435435 }
436436 return null ;
437437 }
438438
439- private JsonMetaSchema getMetaSchemaOrDefault (final JsonNode schemaNode , SchemaValidatorsConfig config ) {
439+ private Dialect getMetaSchemaOrDefault (final JsonNode schemaNode , SchemaValidatorsConfig config ) {
440440 final JsonNode iriNode = schemaNode .get ("$schema" );
441441 if (iriNode != null && !iriNode .isNull () && !iriNode .isTextual ()) {
442442 throw new JsonSchemaException ("Unknown MetaSchema: " + iriNode );
@@ -452,9 +452,9 @@ private JsonMetaSchema getMetaSchemaOrDefault(final JsonNode schemaNode, SchemaV
452452 * @param config the schema validators config
453453 * @return the meta-schema
454454 */
455- public JsonMetaSchema getMetaSchema (String iri , SchemaValidatorsConfig config ) {
455+ public Dialect getMetaSchema (String iri , SchemaValidatorsConfig config ) {
456456 String key = normalizeMetaSchemaUri (iri );
457- JsonMetaSchema result = metaSchemas .computeIfAbsent (key , id -> loadMetaSchema (id , config ));
457+ Dialect result = metaSchemas .computeIfAbsent (key , id -> loadMetaSchema (id , config ));
458458 return result ;
459459 }
460460
@@ -465,7 +465,7 @@ public JsonMetaSchema getMetaSchema(String iri, SchemaValidatorsConfig config) {
465465 * @param config the schema validators config
466466 * @return the meta-schema
467467 */
468- protected JsonMetaSchema loadMetaSchema (String iri , SchemaValidatorsConfig config ) {
468+ protected Dialect loadMetaSchema (String iri , SchemaValidatorsConfig config ) {
469469 return this .metaSchemaFactory != null ? this .metaSchemaFactory .getMetaSchema (iri , this , config )
470470 : DefaultJsonMetaSchemaFactory .getInstance ().getMetaSchema (iri , this , config );
471471 }
@@ -678,7 +678,7 @@ protected JsonSchema getMappedSchema(final SchemaLocation schemaUri, SchemaValid
678678 schemaNode = readTree (inputStream , InputFormat .JSON );
679679 }
680680
681- final JsonMetaSchema jsonMetaSchema = getMetaSchemaOrDefault (schemaNode , config );
681+ final Dialect jsonMetaSchema = getMetaSchemaOrDefault (schemaNode , config );
682682 JsonNodePath evaluationPath = new JsonNodePath (config .getPathType ());
683683 if (schemaUri .getFragment () == null
684684 || schemaUri .getFragment ().getNameCount () == 0 ) {
0 commit comments