Skip to content

Apache Lucene open-source search software

SOLR-10647: move JsonSchemaValidator to SolrJ

Noble Paulf14f2ef6a620
diff --git a/solr/core/src/java/org/apache/solr/api/Api.java b/solr/core/src/java/org/apache/solr/api/Api.java
index edc2206b4a6..d2c468cbfbe 100644
--- a/solr/core/src/java/org/apache/solr/api/Api.java
+++ b/solr/core/src/java/org/apache/solr/api/Api.java
@@ -24,7 +24,7 @@ import org.apache.solr.common.SpecProvider;
import org.apache.solr.common.util.ValidatingJsonMap;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.SolrQueryResponse;
-import org.apache.solr.util.JsonSchemaValidator;
+import org.apache.solr.common.util.JsonSchemaValidator;
/** Every version 2 API must extend the this class. It's mostly like a request handler
* but it has extra methods to provide the json schema of the end point
diff --git a/solr/core/src/java/org/apache/solr/api/ApiBag.java b/solr/core/src/java/org/apache/solr/api/ApiBag.java
index 7f30602045a..805c31ed3f7 100644
--- a/solr/core/src/java/org/apache/solr/api/ApiBag.java
+++ b/solr/core/src/java/org/apache/solr/api/ApiBag.java
@@ -44,7 +44,7 @@ import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.security.AuthorizationContext;
import org.apache.solr.security.PermissionNameProvider;
-import org.apache.solr.util.JsonSchemaValidator;
+import org.apache.solr.common.util.JsonSchemaValidator;
import org.apache.solr.common.util.PathTrie;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
index 36ca4867eb1..baf4abc9972 100644
--- a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
+++ b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
@@ -48,7 +48,7 @@ import org.apache.solr.security.AuthorizationContext;
import org.apache.solr.servlet.HttpSolrCall;
import org.apache.solr.servlet.SolrDispatchFilter;
import org.apache.solr.servlet.SolrRequestParsers;
-import org.apache.solr.util.JsonSchemaValidator;
+import org.apache.solr.common.util.JsonSchemaValidator;
import org.apache.solr.common.util.PathTrie;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java
index 6e81ccfb3bf..510ef482e71 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java
@@ -46,7 +46,7 @@ import org.apache.solr.common.util.CommandOperation;
import org.apache.solr.api.Api;
import org.apache.solr.api.ApiBag.ReqHandlerToApi;
import org.apache.solr.common.SpecProvider;
-import org.apache.solr.util.JsonSchemaValidator;
+import org.apache.solr.common.util.JsonSchemaValidator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java b/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
index 8275991f31f..83e44dd4c38 100644
--- a/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
+++ b/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
@@ -22,7 +22,7 @@ import org.apache.solr.common.util.ValidatingJsonMap;
import org.apache.solr.common.util.SuppressForbidden;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.common.util.CommandOperation;
-import org.apache.solr.util.JsonSchemaValidator;
+import org.apache.solr.common.util.JsonSchemaValidator;
import org.apache.solr.util.RTimerTree;
import org.apache.solr.util.RefCounted;
import org.apache.solr.schema.IndexSchema;
diff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
index f529bd4b689..11b483ad057 100644
--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
@@ -102,7 +102,7 @@ import org.apache.solr.servlet.cache.HttpCacheHeaderUtil;
import org.apache.solr.servlet.cache.Method;
import org.apache.solr.update.processor.DistributingUpdateProcessorFactory;
import org.apache.solr.common.util.CommandOperation;
-import org.apache.solr.util.JsonSchemaValidator;
+import org.apache.solr.common.util.JsonSchemaValidator;
import org.apache.solr.util.RTimerTree;
import org.apache.solr.util.TimeOut;
import org.apache.zookeeper.KeeperException;
diff --git a/solr/core/src/java/org/apache/solr/util/JsonSchemaValidator.java b/solr/solrj/src/java/org/apache/solr/common/util/JsonSchemaValidator.java
similarity index 98%
rename from solr/core/src/java/org/apache/solr/util/JsonSchemaValidator.java
rename to solr/solrj/src/java/org/apache/solr/common/util/JsonSchemaValidator.java
index 8a0a09ff083..e7b725f42a0 100644
--- a/solr/core/src/java/org/apache/solr/util/JsonSchemaValidator.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/JsonSchemaValidator.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.solr.util;
+package org.apache.solr.common.util;
import java.util.Arrays;
import java.util.HashMap;
@@ -27,9 +27,6 @@ import java.util.Map;
import java.util.Set;
import java.util.function.Function;
-import org.apache.solr.common.util.Pair;
-import org.apache.solr.common.util.Utils;
-
/**
* A very basic and lightweight json schema parsing and data validation tool. This custom tool is created
* because a) we need to support non json inputs b) to avoiding double parsing (this accepts an already parsed json as a map)
diff --git a/solr/core/src/test/org/apache/solr/util/JsonValidatorTest.java b/solr/solrj/src/test/org/apache/solr/common/util/JsonValidatorTest.java
similarity index 96%
rename from solr/core/src/test/org/apache/solr/util/JsonValidatorTest.java
rename to solr/solrj/src/test/org/apache/solr/common/util/JsonValidatorTest.java
index a5e50dd1a2b..fa6d080288c 100644
--- a/solr/core/src/test/org/apache/solr/util/JsonValidatorTest.java
+++ b/solr/solrj/src/test/org/apache/solr/common/util/JsonValidatorTest.java
@@ -14,21 +14,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.solr.util;
+package org.apache.solr.common.util;
import java.util.List;
import java.util.Map;
import org.apache.solr.SolrTestCaseJ4;
-import org.apache.solr.common.util.ValidatingJsonMap;
-import org.apache.solr.common.util.StrUtils;
-import org.apache.solr.common.util.Utils;
-import static org.apache.solr.common.util.ValidatingJsonMap.NOT_NULL;
import static org.apache.solr.common.util.Utils.toJSONString;
+import static org.apache.solr.common.util.ValidatingJsonMap.NOT_NULL;
-public class JsonValidatorTest extends SolrTestCaseJ4 {
+public class JsonValidatorTest extends SolrTestCaseJ4 {
public void testSchema() {
checkSchema("collections.Commands");