File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
core/src/main/java/org/everit/json/schema/loader Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -222,13 +222,11 @@ public SchemaLoader(final SchemaLoaderBuilder builder) {
222
222
223
223
private CombinedSchema .Builder buildAnyOfSchemaForMultipleTypes () {
224
224
JSONArray subtypeJsons = ls .schemaJson .getJSONArray ("type" );
225
- Map <String , Object > dummyJson = new HashMap <String , Object >();
226
- Collection <Schema > subschemas = new ArrayList <Schema >(subtypeJsons .length ());
225
+ Collection <Schema > subschemas = new ArrayList <>(subtypeJsons .length ());
227
226
for (int i = 0 ; i < subtypeJsons .length (); ++i ) {
228
227
Object subtypeJson = subtypeJsons .get (i );
229
- dummyJson .put ("type" , subtypeJson );
230
- JSONObject child = new JSONObject (dummyJson );
231
- subschemas .add (loadChild (child ).build ());
228
+ Schema .Builder <?> schemaBuilder = loadForExplicitType ((String ) subtypeJson );
229
+ subschemas .add (schemaBuilder .build ());
232
230
}
233
231
return CombinedSchema .anyOf (subschemas );
234
232
}
You can’t perform that action at this time.
0 commit comments