From 4701671391e87ec51277fa8f0a5d71f9a5578c14 Mon Sep 17 00:00:00 2001 From: redmitry Date: Fri, 30 Aug 2024 10:44:58 +0200 Subject: [PATCH] remove scope from AbstractJsonSchemaElement --- .../schema/impl/DefaultJsonSchemaParser.java | 70 ++++++++----------- .../model/impl/AbstractJsonReferenceImpl.java | 14 ++-- .../schema/model/impl/AbstractJsonSchema.java | 4 +- .../model/impl/AbstractJsonSchemaElement.java | 16 ++--- .../model/impl/BooleanJsonSchemaImpl.java | 4 +- .../json/schema/model/impl/JsonAllOfImpl.java | 4 +- .../json/schema/model/impl/JsonAnyOfImpl.java | 4 +- .../model/impl/JsonArraySchemaImpl.java | 14 ++-- .../model/impl/JsonBooleanSchemaImpl.java | 4 +- .../json/schema/model/impl/JsonConstImpl.java | 4 +- .../impl/JsonDependentPropertiesImpl.java | 4 +- .../model/impl/JsonDynamicReferenceImpl.java | 6 +- .../json/schema/model/impl/JsonEnumImpl.java | 4 +- .../model/impl/JsonIntegerSchemaImpl.java | 4 +- .../impl/JsonMultitypeSchemaWrapper.java | 8 +-- .../json/schema/model/impl/JsonNotImpl.java | 6 +- .../schema/model/impl/JsonNullSchemaImpl.java | 4 +- .../model/impl/JsonNumberSchemaImpl.java | 4 +- .../model/impl/JsonObjectSchemaImpl.java | 24 +++---- .../json/schema/model/impl/JsonOneOfImpl.java | 4 +- .../schema/model/impl/JsonPropertiesImpl.java | 5 +- .../impl/JsonRecursiveReferenceImpl.java | 4 +- .../schema/model/impl/JsonReferenceImpl.java | 4 +- .../model/impl/JsonStringSchemaImpl.java | 4 +- .../schema/model/impl/NumericSchemaImpl.java | 4 +- .../model/impl/PrimitiveSchemaImpl.java | 32 ++++----- .../schema/model/impl/SchemaArrayImpl.java | 6 +- 27 files changed, 126 insertions(+), 139 deletions(-) diff --git a/src/main/java/es/elixir/bsc/json/schema/impl/DefaultJsonSchemaParser.java b/src/main/java/es/elixir/bsc/json/schema/impl/DefaultJsonSchemaParser.java index 934d3dd..08a9855 100644 --- a/src/main/java/es/elixir/bsc/json/schema/impl/DefaultJsonSchemaParser.java +++ b/src/main/java/es/elixir/bsc/json/schema/impl/DefaultJsonSchemaParser.java @@ -87,7 +87,7 @@ public AbstractJsonSchema parse(JsonSchemaLocator locator, AbstractJsonSchemaEle if (value.getValueType() == ValueType.TRUE || value.getValueType() == ValueType.FALSE) { - return new BooleanJsonSchemaImpl(parent, locator, locator, jsonPointer).read(this, value); + return new BooleanJsonSchemaImpl(parent, locator, jsonPointer).read(this, value); } if (value.getValueType() != ValueType.OBJECT) { @@ -106,11 +106,29 @@ public AbstractJsonSchema parse(JsonSchemaLocator locator, AbstractJsonSchemaEle // before draft 2019-09 $ref ignored any other properties if (JsonSchemaVersion.SCHEMA_DRAFT_2019_09.compareTo(getJsonSchemaVersion(locator)) > 0) { - return new JsonReferenceImpl(parent, locator, locator, jsonPointer).read(this, object); + return new JsonReferenceImpl(parent, locator, jsonPointer).read(this, object); } } - final JsonSchemaLocator scope = getScope(locator, object); + JsonValue $id = object.get(JsonSchema.ID); + if ($id == null) { + $id = object.get("id"); // draft4 + } + + if ($id != null) { + if ($id.getValueType() != JsonValue.ValueType.STRING) { + throw new JsonSchemaException(new ParsingError(ParsingMessage.INVALID_ATTRIBUTE_TYPE, + "id", $id.getValueType().name(), JsonValue.ValueType.STRING.name())); + } else { + final String id = ((JsonString)$id).getString(); + try { + locator = locator.resolve(URI.create(id)); + locator.setSchema(object); + } catch(IllegalArgumentException ex) { + throw new JsonSchemaException(new ParsingError(ParsingMessage.INVALID_REFERENCE, id)); + } + } + } final JsonValue type_value = object.get(TYPE); final ValueType vtype; @@ -140,29 +158,29 @@ public AbstractJsonSchema parse(JsonSchemaLocator locator, AbstractJsonSchemaEle if (jenum.isEmpty()) { throw new JsonSchemaException(new ParsingError(ParsingMessage.EMPTY_ENUM)); } - return new JsonEnumImpl(parent, scope, locator, jsonPointer).read(this, object); + return new JsonEnumImpl(parent, locator, jsonPointer).read(this, object); } final JsonValue jconst = object.get(CONST); if (jconst != null) { - return new JsonConstImpl(parent, scope, locator, jsonPointer).read(this, object); + return new JsonConstImpl(parent, locator, jsonPointer).read(this, object); } if (type == null) { - return new JsonMultitypeSchemaWrapper(parent, scope, locator, jsonPointer, + return new JsonMultitypeSchemaWrapper(parent, locator, jsonPointer, vtype == ValueType.ARRAY ? type_value.asJsonArray() : null) .read(this, object); } final AbstractJsonSchema schema; switch(type) { - case OBJECT: schema = new JsonObjectSchemaImpl(parent, scope, locator, jsonPointer); break; - case ARRAY: schema = new JsonArraySchemaImpl(parent, scope, locator, jsonPointer); break; - case STRING: schema = new JsonStringSchemaImpl(parent, scope, locator, jsonPointer); break; - case NUMBER: schema = new JsonNumberSchemaImpl(parent, scope, locator, jsonPointer); break; - case INTEGER: schema = new JsonIntegerSchemaImpl(parent, scope, locator, jsonPointer); break; - case BOOLEAN: schema = new JsonBooleanSchemaImpl(parent, scope, locator, jsonPointer); break; - case NULL: schema = new JsonNullSchemaImpl(parent, scope, locator, jsonPointer); break; + case OBJECT: schema = new JsonObjectSchemaImpl(parent, locator, jsonPointer); break; + case ARRAY: schema = new JsonArraySchemaImpl(parent, locator, jsonPointer); break; + case STRING: schema = new JsonStringSchemaImpl(parent, locator, jsonPointer); break; + case NUMBER: schema = new JsonNumberSchemaImpl(parent, locator, jsonPointer); break; + case INTEGER: schema = new JsonIntegerSchemaImpl(parent, locator, jsonPointer); break; + case BOOLEAN: schema = new JsonBooleanSchemaImpl(parent, locator, jsonPointer); break; + case NULL: schema = new JsonNullSchemaImpl(parent, locator, jsonPointer); break; default: return null; } @@ -198,30 +216,4 @@ public JsonSchemaVersion getJsonSchemaVersion(JsonSchemaLocator locator) { return JsonSchemaVersion.SCHEMA_DRAFT_07; // default } - - private JsonSchemaLocator getScope(JsonSchemaLocator locator, JsonObject object) - throws JsonSchemaException { - - JsonValue $id = object.get(JsonSchema.ID); - if ($id == null) { - $id = object.get("id"); // draft4 - } - - if ($id != null) { - if ($id.getValueType() != JsonValue.ValueType.STRING) { - throw new JsonSchemaException(new ParsingError(ParsingMessage.INVALID_ATTRIBUTE_TYPE, - "id", $id.getValueType().name(), JsonValue.ValueType.STRING.name())); - } else { - final String id = ((JsonString)$id).getString(); - try { - locator = locator.resolve(URI.create(id)); - locator.setSchema(object); - } catch(IllegalArgumentException ex) { - throw new JsonSchemaException(new ParsingError(ParsingMessage.INVALID_REFERENCE, id)); - } - } - } - - return locator; - } } diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/AbstractJsonReferenceImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/AbstractJsonReferenceImpl.java index 98c7e52..fcfc561 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/AbstractJsonReferenceImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/AbstractJsonReferenceImpl.java @@ -56,8 +56,8 @@ public abstract class AbstractJsonReferenceImpl extends AbstractJsonSchema extends AbstractJsonSchemaElement implements JsonSchema { public AbstractJsonSchema(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } public AbstractJsonSchema read(JsonSubschemaParser parser, T value) diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/AbstractJsonSchemaElement.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/AbstractJsonSchemaElement.java index 55b6375..a98923c 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/AbstractJsonSchemaElement.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/AbstractJsonSchemaElement.java @@ -43,7 +43,6 @@ public abstract class AbstractJsonSchemaElement private AbstractJsonSchemaElement parent; - public final JsonSchemaLocator scope; public final JsonSchemaLocator locator; public final String jsonPointer; @@ -55,29 +54,26 @@ public abstract class AbstractJsonSchemaElement * the JSON Schema. * * @param parent a parent element that encloses this one - * @param scope current element scope (may or may not be equal to the location) - * @param locator the locator that was used to load this document + * @param locator current element scope (may or may not be equal to the location) * @param jsonPointer JSON Pointer to the parsed JSON Value that represents this element. */ public AbstractJsonSchemaElement(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { + JsonSchemaLocator locator, String jsonPointer) { this.parent = parent; - this.scope = scope; this.locator = locator; this.jsonPointer = jsonPointer.startsWith("//") ? jsonPointer.substring(1) : jsonPointer; } @Override public final URI getId() { - return scope.uri; + return locator.uri; } @Override public String getJsonPointer() { - // when scope != locator (new scope) jsonPointer is 'root' - return scope == locator ? jsonPointer : "/"; + return parent == null || parent.locator != locator ? "/" : jsonPointer; } @Override @@ -108,7 +104,7 @@ public boolean equals(Object obj) { if (obj instanceof AbstractJsonSchemaElement other && this.getClass() == obj.getClass()) { return Objects.equals(jsonPointer, other.jsonPointer) && - Objects.equals(scope.uri, other.scope.uri); + Objects.equals(locator.uri, other.locator.uri); } return false; } @@ -116,7 +112,7 @@ public boolean equals(Object obj) { @Override public int hashCode() { int hash = 7; - hash = 31 * hash + Objects.hashCode(this.scope.uri); + hash = 31 * hash + Objects.hashCode(this.locator.uri); hash = 31 * hash + Objects.hashCode(this.jsonPointer); hash = 31 * hash + Objects.hashCode(this.getClass().hashCode()); return hash; diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/BooleanJsonSchemaImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/BooleanJsonSchemaImpl.java index 74c08bf..359300a 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/BooleanJsonSchemaImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/BooleanJsonSchemaImpl.java @@ -51,8 +51,8 @@ public class BooleanJsonSchemaImpl extends AbstractJsonSchema private boolean evaluation; public BooleanJsonSchemaImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonAllOfImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonAllOfImpl.java index 9d6cf82..472580c 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonAllOfImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonAllOfImpl.java @@ -45,8 +45,8 @@ public class JsonAllOfImpl extends SchemaArrayImpl implements JsonAllOf { public JsonAllOfImpl(AbstractJsonSchema parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonAnyOfImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonAnyOfImpl.java index e46a414..a7c07be 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonAnyOfImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonAnyOfImpl.java @@ -47,8 +47,8 @@ public class JsonAnyOfImpl extends SchemaArrayImpl implements JsonAnyOf { public JsonAnyOfImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonArraySchemaImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonArraySchemaImpl.java index 75ab910..7d67716 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonArraySchemaImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonArraySchemaImpl.java @@ -72,8 +72,8 @@ public class JsonArraySchemaImpl extends PrimitiveSchemaImpl private Long maxContains; public JsonArraySchemaImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override @@ -178,7 +178,7 @@ public JsonArraySchemaImpl read(JsonSubschemaParser parser, JsonObject object) final JsonValue jcontains = object.get(CONTAINS); if (jcontains != null) { - contains = parser.parse(scope, this, getJsonPointer() + "/" + CONTAINS, jcontains, null); + contains = parser.parse(locator, this, getJsonPointer() + "/" + CONTAINS, jcontains, null); } final JsonNumber jminContains = JsonSchemaUtil.check(object.getJsonNumber(MIN_CONTAINS), JsonValue.ValueType.NUMBER); @@ -196,7 +196,7 @@ public JsonArraySchemaImpl read(JsonSubschemaParser parser, JsonObject object) switch(jitems.getValueType()) { case OBJECT: case TRUE: - case FALSE: final AbstractJsonSchema schema = parser.parse(scope, this, getJsonPointer() + "/" + ITEMS, jitems, null); + case FALSE: final AbstractJsonSchema schema = parser.parse(locator, this, getJsonPointer() + "/" + ITEMS, jitems, null); getItems().add(schema); break; case ARRAY: additionalItems = true; @@ -205,7 +205,7 @@ public JsonArraySchemaImpl read(JsonSubschemaParser parser, JsonObject object) switch(value.getValueType()) { case OBJECT: case TRUE: - case FALSE: final AbstractJsonSchema arr = parser.parse(scope, this, getJsonPointer() + "/" + ITEMS + "/" + i, value, null); + case FALSE: final AbstractJsonSchema arr = parser.parse(locator, this, getJsonPointer() + "/" + ITEMS + "/" + i, value, null); getItems().add(arr); break; default: throw new JsonSchemaException(new ParsingError(ParsingMessage.INVALID_ATTRIBUTE_TYPE, @@ -229,7 +229,7 @@ public JsonArraySchemaImpl read(JsonSubschemaParser parser, JsonObject object) default: throw new JsonSchemaException(new ParsingError(ParsingMessage.INVALID_ATTRIBUTE_TYPE, ADDITIONAL_ITEMS, jadditionalItems.getValueType().name(), "either object or boolean")); } - additionalItemsSchema = parser.parse(scope, this, getJsonPointer() + "/" + ADDITIONAL_ITEMS, jadditionalItems, null); + additionalItemsSchema = parser.parse(locator, this, getJsonPointer() + "/" + ADDITIONAL_ITEMS, jadditionalItems, null); } } @@ -237,7 +237,7 @@ public JsonArraySchemaImpl read(JsonSubschemaParser parser, JsonObject object) if (junevaluatedItems != null) { switch(junevaluatedItems.getValueType()) { case OBJECT: unevaluatedItems = null; - unevaluatedItemsSchema = parser.parse(scope, this, getJsonPointer() + "/" + UNEVALUATED_ITEMS, junevaluatedItems, null); + unevaluatedItemsSchema = parser.parse(locator, this, getJsonPointer() + "/" + UNEVALUATED_ITEMS, junevaluatedItems, null); break; case TRUE: unevaluatedItems = true; break; case FALSE: unevaluatedItems = false; break; diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonBooleanSchemaImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonBooleanSchemaImpl.java index 57d6f39..690321f 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonBooleanSchemaImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonBooleanSchemaImpl.java @@ -44,8 +44,8 @@ public class JsonBooleanSchemaImpl extends PrimitiveSchemaImpl implements JsonBooleanSchema { public JsonBooleanSchemaImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonConstImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonConstImpl.java index 080ce78..7700a05 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonConstImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonConstImpl.java @@ -46,8 +46,8 @@ public class JsonConstImpl extends PrimitiveSchemaImpl implements JsonConst { private JsonValue value; public JsonConstImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonDependentPropertiesImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonDependentPropertiesImpl.java index 6a04a84..71addc7 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonDependentPropertiesImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonDependentPropertiesImpl.java @@ -51,8 +51,8 @@ public class JsonDependentPropertiesImpl extends AbstractJsonSchemaElement private final Map properties = new LinkedHashMap(); public JsonDependentPropertiesImpl(AbstractJsonSchema parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonDynamicReferenceImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonDynamicReferenceImpl.java index 109740b..b7c8df1 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonDynamicReferenceImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonDynamicReferenceImpl.java @@ -46,8 +46,8 @@ public class JsonDynamicReferenceImpl extends JsonReferenceImpl implements JsonDynamicReference { public JsonDynamicReferenceImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); AbstractJsonSchemaElement e = this; do { @@ -97,7 +97,7 @@ public AbstractJsonSchemaElement getSchema() throws JsonSchemaException { private AbstractJsonSchemaElement getSchema(AbstractJsonSchemaElement e, URI uri) throws IOException, JsonSchemaException { final String fragment = uri.getFragment(); - final JsonSchemaLocator l = e.scope.resolve(uri); + final JsonSchemaLocator l = e.locator.resolve(uri); final JsonValue value = l.getSchema("/"); if (value instanceof JsonObject jsubschema) { final String anchor = jsubschema.getString(DYNAMIC_ANCHOR, null); diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonEnumImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonEnumImpl.java index 0e55b89..918ff57 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonEnumImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonEnumImpl.java @@ -45,8 +45,8 @@ public class JsonEnumImpl extends PrimitiveSchemaImpl implements JsonEnum { private List values; public JsonEnumImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonIntegerSchemaImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonIntegerSchemaImpl.java index 78edfab..908a1f7 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonIntegerSchemaImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonIntegerSchemaImpl.java @@ -51,8 +51,8 @@ public class JsonIntegerSchemaImpl extends NumericSchemaImpl implements JsonIntegerSchema { public JsonIntegerSchemaImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonMultitypeSchemaWrapper.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonMultitypeSchemaWrapper.java index 16f7ac1..a9a5865 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonMultitypeSchemaWrapper.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonMultitypeSchemaWrapper.java @@ -56,9 +56,9 @@ public class JsonMultitypeSchemaWrapper extends JsonAnyOfImpl { private final JsonArray types; public JsonMultitypeSchemaWrapper(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer, + JsonSchemaLocator locator, String jsonPointer, JsonArray types) { - super(parent, scope, locator, jsonPointer); + super(parent, locator, jsonPointer); this.types = types; } @@ -79,7 +79,7 @@ public JsonAnyOfImpl read(JsonSubschemaParser parser, JsonObject object) if (types == null) { for (JsonType val : JsonType.values()) { try { - final AbstractJsonSchema s = parser.parse(scope, this, getJsonPointer(), object, val); + final AbstractJsonSchema s = parser.parse(locator, this, getJsonPointer(), object, val); if (s != null) { add(s); } @@ -94,7 +94,7 @@ public JsonAnyOfImpl read(JsonSubschemaParser parser, JsonObject object) } try { final JsonType t = JsonType.fromValue(((JsonString)val).getString()); - add(parser.parse(scope, this, getJsonPointer(), object, t)); + add(parser.parse(locator, this, getJsonPointer(), object, t)); } catch(IllegalArgumentException ex) { throw new JsonSchemaException( new ParsingError(ParsingMessage.UNKNOWN_OBJECT_TYPE, val)); diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonNotImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonNotImpl.java index 8685bae..11d733d 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonNotImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonNotImpl.java @@ -47,8 +47,8 @@ public class JsonNotImpl extends AbstractJsonSchema private AbstractJsonSchema schema; public JsonNotImpl(AbstractJsonSchema parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override @@ -70,7 +70,7 @@ public void setJsonSchema(AbstractJsonSchema schema) { public JsonNotImpl read(JsonSubschemaParser parser, JsonValue value) throws JsonSchemaException { - this.schema = parser.parse(scope, this, getJsonPointer(), value, null); + this.schema = parser.parse(locator, this, getJsonPointer(), value, null); return this; } diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonNullSchemaImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonNullSchemaImpl.java index f84a79b..9e5fe02 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonNullSchemaImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonNullSchemaImpl.java @@ -44,8 +44,8 @@ public class JsonNullSchemaImpl extends PrimitiveSchemaImpl implements JsonNullSchema { public JsonNullSchemaImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonNumberSchemaImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonNumberSchemaImpl.java index d780f13..d3d06b2 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonNumberSchemaImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonNumberSchemaImpl.java @@ -46,8 +46,8 @@ public class JsonNumberSchemaImpl extends NumericSchemaImpl implements JsonNumberSchema { public JsonNumberSchemaImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonObjectSchemaImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonObjectSchemaImpl.java index 964dee7..1b209f0 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonObjectSchemaImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonObjectSchemaImpl.java @@ -76,8 +76,8 @@ public class JsonObjectSchemaImpl extends PrimitiveSchemaImpl private AbstractJsonSchema propertyNames; public JsonObjectSchemaImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override @@ -121,7 +121,7 @@ public StringArray getRequired() { public JsonProperties getDependentSchemas() { if (dependentSchemas == null) { dependentSchemas = new JsonPropertiesImpl(this, - scope, scope, jsonPointer + "/" + DEPENDENT_SCHEMAS); + locator, jsonPointer + "/" + DEPENDENT_SCHEMAS); } return dependentSchemas; } @@ -130,7 +130,7 @@ public JsonProperties getDependentSchemas() { public JsonDependentProperties getDependentRequired() { if (dependentRequired == null) { dependentRequired = new JsonDependentPropertiesImpl(this, - scope, scope, jsonPointer + "/" + DEPENDENT_REQUIRED); + locator, jsonPointer + "/" + DEPENDENT_REQUIRED); } return dependentRequired; } @@ -173,7 +173,7 @@ public JsonObjectSchemaImpl read(JsonSubschemaParser parser, JsonObject object) final JsonObject jproperties = JsonSchemaUtil.check(object.get(PROPERTIES), ValueType.OBJECT); if (jproperties != null) { - properties = new JsonPropertiesImpl(this, scope, scope, jsonPointer + "/" + PROPERTIES) + properties = new JsonPropertiesImpl(this, locator, jsonPointer + "/" + PROPERTIES) .read(parser, jproperties); } @@ -189,7 +189,7 @@ public JsonObjectSchemaImpl read(JsonSubschemaParser parser, JsonObject object) final JsonObject jpatternProperties = JsonSchemaUtil.check(object.get(PATTERN_PROPERTIES), ValueType.OBJECT); if (jpatternProperties != null) { - patternProperties = new JsonPropertiesImpl(this, scope, scope, jsonPointer + "/" + PATTERN_PROPERTIES) + patternProperties = new JsonPropertiesImpl(this, locator, jsonPointer + "/" + PATTERN_PROPERTIES) .read(parser, jpatternProperties); } @@ -201,7 +201,7 @@ public JsonObjectSchemaImpl read(JsonSubschemaParser parser, JsonObject object) final JsonValue jadditionalProperties = object.get(ADDITIONAL_PROPERTIES); if (jadditionalProperties != null) { switch(jadditionalProperties.getValueType()) { - case OBJECT: additionalPropertiesSchema = parser.parse(scope, this, getJsonPointer() + "/" + ADDITIONAL_PROPERTIES, jadditionalProperties, null); break; + case OBJECT: additionalPropertiesSchema = parser.parse(locator, this, getJsonPointer() + "/" + ADDITIONAL_PROPERTIES, jadditionalProperties, null); break; case TRUE: additionalProperties = true; break; case FALSE: additionalProperties = false; break; default: throw new JsonSchemaException(new ParsingError(ParsingMessage.INVALID_ATTRIBUTE_TYPE, @@ -212,7 +212,7 @@ public JsonObjectSchemaImpl read(JsonSubschemaParser parser, JsonObject object) final JsonValue junevaluatedProperties = object.get(UNEVALUATED_PROPERTIES); if (junevaluatedProperties != null) { switch(junevaluatedProperties.getValueType()) { - case OBJECT: unevaluatedPropertiesSchema = parser.parse(scope, this, getJsonPointer() + "/" + UNEVALUATED_PROPERTIES, junevaluatedProperties, null); break; + case OBJECT: unevaluatedPropertiesSchema = parser.parse(locator, this, getJsonPointer() + "/" + UNEVALUATED_PROPERTIES, junevaluatedProperties, null); break; case TRUE: unevaluatedProperties = true; break; case FALSE: unevaluatedProperties = false; break; default: throw new JsonSchemaException(new ParsingError(ParsingMessage.INVALID_ATTRIBUTE_TYPE, @@ -222,18 +222,18 @@ public JsonObjectSchemaImpl read(JsonSubschemaParser parser, JsonObject object) final JsonValue jpropertyNames = object.get(PROPERTY_NAMES); if (jpropertyNames != null) { - propertyNames = parser.parse(scope, this, getJsonPointer() + "/" + PROPERTY_NAMES, jpropertyNames, JsonType.STRING); + propertyNames = parser.parse(locator, this, getJsonPointer() + "/" + PROPERTY_NAMES, jpropertyNames, JsonType.STRING); } final JsonObject jdependentSchemas = JsonSchemaUtil.check(object.get(DEPENDENT_SCHEMAS), ValueType.OBJECT); if (jdependentSchemas != null) { - dependentSchemas = new JsonPropertiesImpl(this, scope, scope, + dependentSchemas = new JsonPropertiesImpl(this, locator, jsonPointer + "/" + DEPENDENT_SCHEMAS).read(parser, jdependentSchemas); } final JsonObject jdependentRequired = JsonSchemaUtil.check(object.get(DEPENDENT_REQUIRED), ValueType.OBJECT); if (jdependentRequired != null) { - dependentRequired = new JsonDependentPropertiesImpl(this, scope, scope, + dependentRequired = new JsonDependentPropertiesImpl(this, locator, jsonPointer + "/" + DEPENDENT_REQUIRED).read(parser, jdependentRequired); } @@ -246,7 +246,7 @@ public JsonObjectSchemaImpl read(JsonSubschemaParser parser, JsonObject object) switch(value.getValueType()) { case OBJECT: case TRUE: - case FALSE: final AbstractJsonSchema schema = parser.parse(scope, this, getJsonPointer() + "/" + DEPENDENCIES + "/" + name + "/", value, null); + case FALSE: final AbstractJsonSchema schema = parser.parse(locator, this, getJsonPointer() + "/" + DEPENDENCIES + "/" + name + "/", value, null); getDependentSchemas().put(name, schema); break; case ARRAY: final StringArray arr = new JsonStringArray().read(value.asJsonArray()); diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonOneOfImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonOneOfImpl.java index 1cf8fe8..3c6b73f 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonOneOfImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonOneOfImpl.java @@ -45,8 +45,8 @@ public class JsonOneOfImpl extends SchemaArrayImpl implements JsonOneOf { public JsonOneOfImpl(AbstractJsonSchema parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonPropertiesImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonPropertiesImpl.java index 5837445..7dfb862 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonPropertiesImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonPropertiesImpl.java @@ -29,7 +29,6 @@ import es.elixir.bsc.json.schema.JsonSchemaLocator; import es.elixir.bsc.json.schema.impl.JsonSubschemaParser; import es.elixir.bsc.json.schema.model.JsonProperties; -import es.elixir.bsc.json.schema.model.JsonSchemaElement; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; @@ -48,8 +47,8 @@ public class JsonPropertiesImpl extends AbstractJsonSchemaElement private final Map properties = new LinkedHashMap(); public JsonPropertiesImpl(AbstractJsonSchema parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonRecursiveReferenceImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonRecursiveReferenceImpl.java index 239919b..e415e51 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonRecursiveReferenceImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonRecursiveReferenceImpl.java @@ -46,8 +46,8 @@ public class JsonRecursiveReferenceImpl extends AbstractJsonReferenceImpl implements JsonRecursiveReference { public JsonRecursiveReferenceImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); AbstractJsonSchemaElement e = this; do { diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonReferenceImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonReferenceImpl.java index 018a095..2571044 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonReferenceImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonReferenceImpl.java @@ -44,8 +44,8 @@ public class JsonReferenceImpl extends AbstractJsonReferenceImpl implements JsonReference { public JsonReferenceImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonStringSchemaImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonStringSchemaImpl.java index aeb8105..6d75dff 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonStringSchemaImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonStringSchemaImpl.java @@ -55,8 +55,8 @@ public class JsonStringSchemaImpl extends PrimitiveSchemaImpl private Pattern pattern; public JsonStringSchemaImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/NumericSchemaImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/NumericSchemaImpl.java index 961379a..327b544 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/NumericSchemaImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/NumericSchemaImpl.java @@ -55,8 +55,8 @@ public abstract class NumericSchemaImpl extends PrimitiveSchem protected Number exclusiveMaximum; public NumericSchemaImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/PrimitiveSchemaImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/PrimitiveSchemaImpl.java index 8a03669..4796cf2 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/PrimitiveSchemaImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/PrimitiveSchemaImpl.java @@ -83,8 +83,8 @@ public class PrimitiveSchemaImpl extends AbstractJsonSchema private AbstractJsonReferenceImpl ref; public PrimitiveSchemaImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); } @Override @@ -186,7 +186,7 @@ public PrimitiveSchemaImpl read(JsonSubschemaParser parser, JsonObject object) final JsonString janchor = JsonSchemaUtil.check(object.get(JsonSchema.ANCHOR), JsonValue.ValueType.STRING); if (janchor != null) { anchor = janchor.getString(); - scope.resolve(URI.create("#" + anchor)).setSchema(object); + locator.resolve(URI.create("#" + anchor)).setSchema(object); } final JsonValue jrecursiveanchor = object.get(RECURSIVE_ANCHOR); @@ -202,7 +202,7 @@ public PrimitiveSchemaImpl read(JsonSubschemaParser parser, JsonObject object) final JsonString jdynamicanchor = JsonSchemaUtil.check(object.get(JsonSchema.DYNAMIC_ANCHOR), JsonValue.ValueType.STRING); if (jdynamicanchor != null) { dynamic_anchor = jdynamicanchor.getString(); - scope.resolve(URI.create("#" + dynamic_anchor)).setSchema(object); + locator.resolve(URI.create("#" + dynamic_anchor)).setSchema(object); } JsonValue jdefs = object.get(JsonSchema.DEFS); @@ -212,7 +212,7 @@ public PrimitiveSchemaImpl read(JsonSubschemaParser parser, JsonObject object) JsonSchema.DEFS, jdefs.getValueType().name(), JsonValue.ValueType.OBJECT.name())); } for (Map.Entry entry : jdefs.asJsonObject().entrySet()) { - parser.parse(scope, this, getJsonPointer() + "/" + JsonSchema.DEFS + "/" + entry.getKey(), entry.getValue(), null); + parser.parse(locator, this, getJsonPointer() + "/" + JsonSchema.DEFS + "/" + entry.getKey(), entry.getValue(), null); } } @@ -223,13 +223,13 @@ public PrimitiveSchemaImpl read(JsonSubschemaParser parser, JsonObject object) "definitions", jdefinitions.getValueType().name(), JsonValue.ValueType.OBJECT.name())); } for (Map.Entry entry : jdefinitions.asJsonObject().entrySet()) { - parser.parse(scope, this, getJsonPointer() + "/definitions/" + entry.getKey(), entry.getValue(), null); + parser.parse(locator, this, getJsonPointer() + "/definitions/" + entry.getKey(), entry.getValue(), null); } } final JsonArray jallOf = JsonSchemaUtil.check(object.get(ALL_OF), JsonValue.ValueType.ARRAY); if (jallOf != null) { - final JsonAllOfImpl _allOf = new JsonAllOfImpl(this, scope, scope, jsonPointer + "/" + ALL_OF) + final JsonAllOfImpl _allOf = new JsonAllOfImpl(this, locator, jsonPointer + "/" + ALL_OF) .read(parser, jallOf); if (allOf == null) { allOf = _allOf; @@ -242,13 +242,13 @@ public PrimitiveSchemaImpl read(JsonSubschemaParser parser, JsonObject object) final JsonArray janyOf = JsonSchemaUtil.check(object.get(ANY_OF), JsonValue.ValueType.ARRAY); if (janyOf != null) { - anyOf = new JsonAnyOfImpl(this, scope, scope, jsonPointer + "/" + ANY_OF); + anyOf = new JsonAnyOfImpl(this, locator, jsonPointer + "/" + ANY_OF); anyOf.read(parser, janyOf); } final JsonArray joneOf = JsonSchemaUtil.check(object.get(ONE_OF), JsonValue.ValueType.ARRAY); if (joneOf != null) { - oneOf = new JsonOneOfImpl(this, scope, scope, jsonPointer + "/" + ONE_OF); + oneOf = new JsonOneOfImpl(this, locator, jsonPointer + "/" + ONE_OF); oneOf.read(parser, joneOf); } @@ -257,7 +257,7 @@ public PrimitiveSchemaImpl read(JsonSubschemaParser parser, JsonObject object) switch(jnot.getValueType()) { case OBJECT: case TRUE: - case FALSE: not = new JsonNotImpl(this, scope, scope, jsonPointer + "/" + NOT) + case FALSE: not = new JsonNotImpl(this, locator, jsonPointer + "/" + NOT) .read(parser, jnot); break; default: throw new JsonSchemaException(new ParsingError(ParsingMessage.INVALID_ATTRIBUTE_TYPE, @@ -267,17 +267,17 @@ public PrimitiveSchemaImpl read(JsonSubschemaParser parser, JsonObject object) final JsonValue jif = object.get(IF); if (jif != null) { - _if = parser.parse(scope, this, getJsonPointer() + "/" + IF, jif, null); + _if = parser.parse(locator, this, getJsonPointer() + "/" + IF, jif, null); } final JsonValue jelse = object.get(ELSE); if (jelse != null) { - _else = parser.parse(scope, this, getJsonPointer() + "/" + ELSE, jelse, null); + _else = parser.parse(locator, this, getJsonPointer() + "/" + ELSE, jelse, null); } final JsonValue jthen = object.get(THEN); if (jthen != null) { - _then = parser.parse(scope, this, getJsonPointer() + "/" + THEN, jthen, null); + _then = parser.parse(locator, this, getJsonPointer() + "/" + THEN, jthen, null); } final JsonValue jref = object.get(JsonReference.REF); @@ -288,7 +288,7 @@ public PrimitiveSchemaImpl read(JsonSubschemaParser parser, JsonObject object) JsonReference.REF, jref.getValueType().name(), JsonValue.ValueType.STRING.name())); } - ref = new JsonReferenceImpl(this, scope, scope, jsonPointer).read(parser, object); + ref = new JsonReferenceImpl(this, locator, jsonPointer).read(parser, object); } final JsonValue jdynamic_ref = object.get(JsonDynamicReference.DYNAMIC_REF); @@ -303,7 +303,7 @@ public PrimitiveSchemaImpl read(JsonSubschemaParser parser, JsonObject object) throw new JsonSchemaException(new ParsingError(ParsingMessage.INCOMPATIBLE_KEYWORDS, String.join(",", List.of(JsonRecursiveReference.REF, JsonDynamicReference.DYNAMIC_REF)))); } - ref = new JsonDynamicReferenceImpl(this, scope, scope, jsonPointer).read(parser, object); + ref = new JsonDynamicReferenceImpl(this, locator, jsonPointer).read(parser, object); } final JsonValue jrecursive_ref = object.get(JsonRecursiveReference.RECURSIVE_REF); @@ -319,7 +319,7 @@ public PrimitiveSchemaImpl read(JsonSubschemaParser parser, JsonObject object) String.join(",", List.of(JsonRecursiveReference.REF, JsonRecursiveReference.RECURSIVE_REF)))); } - ref = new JsonRecursiveReferenceImpl(this, scope, scope, jsonPointer).read(parser, object); + ref = new JsonRecursiveReferenceImpl(this, locator, jsonPointer).read(parser, object); } return this; diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/SchemaArrayImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/SchemaArrayImpl.java index 4c0d178..d0fcb4b 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/SchemaArrayImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/SchemaArrayImpl.java @@ -49,8 +49,8 @@ public abstract class SchemaArrayImpl private final Set schemas; public SchemaArrayImpl(AbstractJsonSchemaElement parent, - JsonSchemaLocator scope, JsonSchemaLocator locator, String jsonPointer) { - super(parent, scope, locator, jsonPointer); + JsonSchemaLocator locator, String jsonPointer) { + super(parent, locator, jsonPointer); schemas = new HashSet(); } @@ -89,7 +89,7 @@ public SchemaArrayImpl read(JsonSubschemaParser parser, JsonArray array) for (int i = 0, n = array.size(); i < n; i++) { final JsonValue value = array.get(i); - final AbstractJsonSchema schema = parser.parse(scope, this, + final AbstractJsonSchema schema = parser.parse(locator, this, getJsonPointer() + "/" + Integer.toString(i), value, null); add(schema); }