From 50c1a6b343c5b6417a86b609c1e39609b681754e Mon Sep 17 00:00:00 2001 From: Sebastian Toepfer <61313468+sebastian-toepfer@users.noreply.github.com> Date: Sun, 10 Sep 2023 19:21:47 +0200 Subject: [PATCH] split core into multiple parts i know with java modules it's not longer needed, but is helps me to create a better structure. --- api/pom.xml | 49 ++++++++++++ .../jsonschema}/ConstraintViolation.java | 2 +- .../jsonschema}/InstanceType.java | 2 +- .../jsonschema}/JsonSchema.java | 2 +- .../jsonschema}/JsonSchemas.java | 4 +- .../jsonschema}/Validator.java | 2 +- .../jsonschema}/Vocabulary.java | 4 +- .../jsonschema}/keyword/Annotation.java | 2 +- .../jsonschema}/keyword/Applicator.java | 2 +- .../jsonschema}/keyword/Assertion.java | 2 +- .../keyword/DefaultAnnotation.java | 2 +- .../jsonschema}/keyword/Identifier.java | 2 +- .../jsonschema}/keyword/Keyword.java | 2 +- .../jsonschema}/keyword/KeywordType.java | 2 +- .../jsonschema}/keyword/ReservedLocation.java | 2 +- .../jsonschema}/spi/JsonSchemaFactory.java | 4 +- api/src/main/java/module-info.java | 31 ++++++++ .../jsonschema/FakeJsonSchemaFactory.java | 45 +++++++++++ .../jsonschema/InstanceTypeTest.java | 75 +++++++++++++++++++ .../jsonschema}/JsonSchemasTest.java | 2 +- .../jsonschema}/keyword/AnnotationTest.java | 2 +- .../jsonschema}/keyword/ApplicatorTest.java | 2 +- .../jsonschema}/keyword/AssertionTest.java | 2 +- .../keyword/DefaultAnnotationTest.java | 2 +- .../jsonschema}/keyword/IdentifierTest.java | 4 +- .../jsonschema}/keyword/KeywordTypeTest.java | 2 +- .../keyword/ReservedLocationTest.java | 2 +- ...antoepfer.jsonschema.spi.JsonSchemaFactory | 1 + core/pom.xml | 11 +++ .../spi => }/AbstractJsonValueSchema.java | 4 +- .../{impl/spi => }/DefaultJsonSchema.java | 14 ++-- .../spi => }/DefaultJsonSchemaFactory.java | 6 +- .../core/{impl/spi => }/DefaultValidator.java | 8 +- .../core/{impl/spi => }/EmptyJsonSchema.java | 6 +- .../core/{impl/spi => }/FalseJsonSchema.java | 6 +- .../core/{impl/spi => }/KeywordSearch.java | 6 +- .../core/{impl/spi => }/Keywords.java | 14 ++-- .../core/{impl/spi => }/TrueJsonSchema.java | 6 +- .../constraint/AllOfConstraint.java | 4 +- .../{impl => }/constraint/AnyConstraint.java | 4 +- .../{impl => }/constraint/Constraint.java | 4 +- .../{impl => }/constraint/NoConstraint.java | 4 +- .../constraint/UnfulfillableConstraint.java | 4 +- .../{impl => }/vocab/ConstraintAssertion.java | 6 +- .../vocab/basic/BasicVocabulary.java | 6 +- .../vocab/basic/TypeKeywordType.java | 16 ++-- .../vocab/basic/UnknowKeywordType.java | 8 +- .../vocab/core/CommentKeywordType.java | 8 +- .../{impl => }/vocab/core/CoreVocabulary.java | 6 +- .../vocab/core/DefsKeywordType.java | 8 +- .../vocab/core/DynamicRefKeywordType.java | 8 +- .../{impl => }/vocab/core/IdKeywordType.java | 8 +- .../vocab/core/LazyCoreVocabulary.java | 6 +- .../{impl => }/vocab/core/RefKeywordType.java | 8 +- .../vocab/core/SchemaKeywordType.java | 8 +- .../vocab/core/VocabularyKeywordType.java | 12 +-- core/src/main/java/module-info.java | 14 ++-- ...pfer.jsonschema.core.spi.JsonSchemaFactory | 1 - ...jsonschema.core.vocab.spi.LazyVocabularies | 1 - ...antoepfer.jsonschema.spi.JsonSchemaFactory | 1 + ...jsonschema.vocabulary.spi.LazyVocabularies | 1 + .../spi => }/AbstractJsonValueSchemaTest.java | 9 +-- .../DefaultJsonSchemaFactoryTest.java | 2 +- .../{impl/spi => }/DefaultJsonSchemaTest.java | 2 +- .../{impl/spi => }/EmptyJsonSchemaTest.java | 2 +- .../{impl/spi => }/FalseJsonSchemaTest.java | 2 +- .../{impl/spi => }/JsonValuesArguments.java | 2 +- .../core/{impl/spi => }/KeywordsTest.java | 8 +- .../{impl/spi => }/TrueJsonSchemaTest.java | 2 +- .../JsonTestSuiteTestCaseProvider.java | 2 +- .../vocab/ConstraintAssertionTest.java | 7 +- .../vocab/basic/BasicVocabularyTest.java | 5 +- .../core/{impl => }/vocab/basic/TypeTest.java | 5 +- .../vocab/core/CoreVocabularyTest.java | 3 +- .../vocab/core/DynamicRefKeywordTypeTest.java | 5 +- .../core/LazyCoreVocabularyTest.java} | 36 ++++----- .../vocab/core/RefKeywordTypeTest.java | 5 +- .../vocab/core/VocabularyKeywordTypeTest.java | 9 ++- core/src/test/java/module-info.java | 2 + ....testsuite.junit.SchemaTestValidatorLoader | 1 - pom.xml | 4 +- vocabulary-spi/pom.xml | 46 ++++++++++++ .../vocabulary}/spi/LazyVocabularies.java | 4 +- .../vocabulary}/spi/VocabularyDefinition.java | 4 +- .../spi/VocabularyDefinitions.java | 2 +- vocabulary-spi/src/main/java/module-info.java | 29 +++++++ .../vocabulary}/spi/LazyVocabulariesTest.java | 6 +- .../vocabulary/spi/TestLazyVocabularies.java | 53 +++++++++++++ .../spi/VocabularyDefinitionTest.java | 4 +- ...jsonschema.vocabulary.spi.LazyVocabularies | 1 + 90 files changed, 544 insertions(+), 200 deletions(-) create mode 100644 api/pom.xml rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/ConstraintViolation.java (95%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/InstanceType.java (97%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/JsonSchema.java (96%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/JsonSchemas.java (93%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/Validator.java (96%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/Vocabulary.java (91%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/keyword/Annotation.java (96%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/keyword/Applicator.java (96%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/keyword/Assertion.java (96%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/keyword/DefaultAnnotation.java (97%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/keyword/Identifier.java (96%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/keyword/Keyword.java (97%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/keyword/KeywordType.java (95%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/keyword/ReservedLocation.java (96%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core => api/src/main/java/io/github/sebastiantoepfer/jsonschema}/spi/JsonSchemaFactory.java (91%) create mode 100644 api/src/main/java/module-info.java create mode 100644 api/src/test/java/io/github/sebastiantoepfer/jsonschema/FakeJsonSchemaFactory.java create mode 100644 api/src/test/java/io/github/sebastiantoepfer/jsonschema/InstanceTypeTest.java rename {core/src/test/java/io/github/sebastiantoepfer/jsonschema/core => api/src/test/java/io/github/sebastiantoepfer/jsonschema}/JsonSchemasTest.java (96%) rename {core/src/test/java/io/github/sebastiantoepfer/jsonschema/core => api/src/test/java/io/github/sebastiantoepfer/jsonschema}/keyword/AnnotationTest.java (97%) rename {core/src/test/java/io/github/sebastiantoepfer/jsonschema/core => api/src/test/java/io/github/sebastiantoepfer/jsonschema}/keyword/ApplicatorTest.java (97%) rename {core/src/test/java/io/github/sebastiantoepfer/jsonschema/core => api/src/test/java/io/github/sebastiantoepfer/jsonschema}/keyword/AssertionTest.java (97%) rename {core/src/test/java/io/github/sebastiantoepfer/jsonschema/core => api/src/test/java/io/github/sebastiantoepfer/jsonschema}/keyword/DefaultAnnotationTest.java (96%) rename {core/src/test/java/io/github/sebastiantoepfer/jsonschema/core => api/src/test/java/io/github/sebastiantoepfer/jsonschema}/keyword/IdentifierTest.java (94%) rename {core/src/test/java/io/github/sebastiantoepfer/jsonschema/core => api/src/test/java/io/github/sebastiantoepfer/jsonschema}/keyword/KeywordTypeTest.java (96%) rename {core/src/test/java/io/github/sebastiantoepfer/jsonschema/core => api/src/test/java/io/github/sebastiantoepfer/jsonschema}/keyword/ReservedLocationTest.java (97%) create mode 100644 api/src/test/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.spi.JsonSchemaFactory rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/AbstractJsonValueSchema.java (93%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/DefaultJsonSchema.java (82%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/DefaultJsonSchemaFactory.java (89%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/DefaultValidator.java (85%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/EmptyJsonSchema.java (87%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/FalseJsonSchema.java (87%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/KeywordSearch.java (88%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/Keywords.java (86%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/TrueJsonSchema.java (87%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/constraint/AllOfConstraint.java (93%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/constraint/AnyConstraint.java (94%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/constraint/Constraint.java (90%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/constraint/NoConstraint.java (90%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/constraint/UnfulfillableConstraint.java (90%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/ConstraintAssertion.java (86%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/basic/BasicVocabulary.java (89%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/basic/TypeKeywordType.java (88%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/basic/UnknowKeywordType.java (84%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/CommentKeywordType.java (84%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/CoreVocabulary.java (91%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/DefsKeywordType.java (84%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/DynamicRefKeywordType.java (87%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/IdKeywordType.java (84%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/LazyCoreVocabulary.java (89%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/RefKeywordType.java (87%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/SchemaKeywordType.java (84%) rename core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/VocabularyKeywordType.java (88%) delete mode 100644 core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.core.spi.JsonSchemaFactory delete mode 100644 core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.core.vocab.spi.LazyVocabularies create mode 100644 core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.spi.JsonSchemaFactory create mode 100644 core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.vocabulary.spi.LazyVocabularies rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/AbstractJsonValueSchemaTest.java (88%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/DefaultJsonSchemaFactoryTest.java (97%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/DefaultJsonSchemaTest.java (97%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/EmptyJsonSchemaTest.java (96%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/FalseJsonSchemaTest.java (96%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/JsonValuesArguments.java (96%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/KeywordsTest.java (89%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl/spi => }/TrueJsonSchemaTest.java (96%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/ConstraintAssertionTest.java (89%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/basic/BasicVocabularyTest.java (91%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/basic/TypeTest.java (93%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/CoreVocabularyTest.java (94%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/DynamicRefKeywordTypeTest.java (88%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{InstanceTypeTest.java => vocab/core/LazyCoreVocabularyTest.java} (51%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/RefKeywordTypeTest.java (89%) rename core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/{impl => }/vocab/core/VocabularyKeywordTypeTest.java (89%) delete mode 100644 core/src/test/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.testsuite.junit.SchemaTestValidatorLoader create mode 100644 vocabulary-spi/pom.xml rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab => vocabulary-spi/src/main/java/io/github/sebastiantoepfer/jsonschema/vocabulary}/spi/LazyVocabularies.java (91%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab => vocabulary-spi/src/main/java/io/github/sebastiantoepfer/jsonschema/vocabulary}/spi/VocabularyDefinition.java (93%) rename {core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab => vocabulary-spi/src/main/java/io/github/sebastiantoepfer/jsonschema/vocabulary}/spi/VocabularyDefinitions.java (95%) create mode 100644 vocabulary-spi/src/main/java/module-info.java rename {core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab => vocabulary-spi/src/test/java/io/github/sebastiantoepfer/jsonschema/vocabulary}/spi/LazyVocabulariesTest.java (92%) create mode 100644 vocabulary-spi/src/test/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/TestLazyVocabularies.java rename {core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab => vocabulary-spi/src/test/java/io/github/sebastiantoepfer/jsonschema/vocabulary}/spi/VocabularyDefinitionTest.java (95%) create mode 100644 vocabulary-spi/src/test/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.vocabulary.spi.LazyVocabularies diff --git a/api/pom.xml b/api/pom.xml new file mode 100644 index 00000000..d9d19f5c --- /dev/null +++ b/api/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + + io.github.sebastian-toepfer.json-schema + json-schema + 0.1.0-SNAPSHOT + + + json-schema-api + Json Schema :: api + + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-params + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + + org.hamcrest + hamcrest + test + + + + jakarta.json + jakarta.json-api + provided + + + + org.eclipse.parsson + parsson + test + + + diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/ConstraintViolation.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/ConstraintViolation.java similarity index 95% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/ConstraintViolation.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/ConstraintViolation.java index ca12797f..06a3d018 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/ConstraintViolation.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/ConstraintViolation.java @@ -21,6 +21,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core; +package io.github.sebastiantoepfer.jsonschema; public final class ConstraintViolation {} diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/InstanceType.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/InstanceType.java similarity index 97% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/InstanceType.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/InstanceType.java index 31bd7b50..ffac968d 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/InstanceType.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/InstanceType.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core; +package io.github.sebastiantoepfer.jsonschema; import jakarta.json.JsonNumber; import jakarta.json.JsonValue; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/JsonSchema.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/JsonSchema.java similarity index 96% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/JsonSchema.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/JsonSchema.java index 3c1a07ab..98ffbcb4 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/JsonSchema.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/JsonSchema.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core; +package io.github.sebastiantoepfer.jsonschema; import jakarta.json.JsonValue; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/JsonSchemas.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/JsonSchemas.java similarity index 93% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/JsonSchemas.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/JsonSchemas.java index df60a3bf..68fecd04 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/JsonSchemas.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/JsonSchemas.java @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core; +package io.github.sebastiantoepfer.jsonschema; -import io.github.sebastiantoepfer.jsonschema.core.spi.JsonSchemaFactory; +import io.github.sebastiantoepfer.jsonschema.spi.JsonSchemaFactory; import jakarta.json.Json; import jakarta.json.JsonReader; import jakarta.json.JsonValue; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/Validator.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/Validator.java similarity index 96% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/Validator.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/Validator.java index acb54a1d..26c6305e 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/Validator.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/Validator.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core; +package io.github.sebastiantoepfer.jsonschema; import jakarta.json.Json; import jakarta.json.JsonReader; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/Vocabulary.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/Vocabulary.java similarity index 91% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/Vocabulary.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/Vocabulary.java index abe04c48..62f22a24 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/Vocabulary.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/Vocabulary.java @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core; +package io.github.sebastiantoepfer.jsonschema; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import java.net.URI; import java.util.Optional; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Annotation.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Annotation.java similarity index 96% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Annotation.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Annotation.java index 08efb16c..f7e2ae47 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Annotation.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Annotation.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import jakarta.json.JsonValue; import java.util.Collection; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Applicator.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Applicator.java similarity index 96% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Applicator.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Applicator.java index c72ef964..6fefab8c 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Applicator.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Applicator.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import jakarta.json.JsonValue; import java.util.Collection; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Assertion.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Assertion.java similarity index 96% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Assertion.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Assertion.java index 08f674fc..2def625a 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Assertion.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Assertion.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import jakarta.json.JsonValue; import java.util.Collection; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/DefaultAnnotation.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/DefaultAnnotation.java similarity index 97% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/DefaultAnnotation.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/DefaultAnnotation.java index 53729a5f..52ba76c3 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/DefaultAnnotation.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/DefaultAnnotation.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import jakarta.json.JsonValue; import java.util.Objects; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Identifier.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Identifier.java similarity index 96% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Identifier.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Identifier.java index 16818b10..e947d35e 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Identifier.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Identifier.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import java.net.URI; import java.util.Collection; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Keyword.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Keyword.java similarity index 97% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Keyword.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Keyword.java index 9b4b9b15..40e55913 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/Keyword.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/Keyword.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import java.util.Collection; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/KeywordType.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/KeywordType.java similarity index 95% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/KeywordType.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/KeywordType.java index 85f08a56..edb6a275 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/KeywordType.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/KeywordType.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import jakarta.json.JsonValue; import java.util.Objects; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/ReservedLocation.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/ReservedLocation.java similarity index 96% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/ReservedLocation.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/ReservedLocation.java index fec1a07d..0f8956e8 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/keyword/ReservedLocation.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/keyword/ReservedLocation.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import java.util.Collection; import java.util.Set; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/spi/JsonSchemaFactory.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/spi/JsonSchemaFactory.java similarity index 91% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/spi/JsonSchemaFactory.java rename to api/src/main/java/io/github/sebastiantoepfer/jsonschema/spi/JsonSchemaFactory.java index b0f1180d..81a0d245 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/spi/JsonSchemaFactory.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/spi/JsonSchemaFactory.java @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.spi; +package io.github.sebastiantoepfer.jsonschema.spi; -import io.github.sebastiantoepfer.jsonschema.core.JsonSchema; +import io.github.sebastiantoepfer.jsonschema.JsonSchema; import jakarta.json.JsonValue; public interface JsonSchemaFactory { diff --git a/api/src/main/java/module-info.java b/api/src/main/java/module-info.java new file mode 100644 index 00000000..9ead3edd --- /dev/null +++ b/api/src/main/java/module-info.java @@ -0,0 +1,31 @@ +/* + * The MIT License + * + * Copyright 2023 sebastian. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module io.github.sebastiantoepfer.jsonschema { + exports io.github.sebastiantoepfer.jsonschema; + exports io.github.sebastiantoepfer.jsonschema.keyword; + exports io.github.sebastiantoepfer.jsonschema.spi; + + requires jakarta.json; +} diff --git a/api/src/test/java/io/github/sebastiantoepfer/jsonschema/FakeJsonSchemaFactory.java b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/FakeJsonSchemaFactory.java new file mode 100644 index 00000000..c294fd20 --- /dev/null +++ b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/FakeJsonSchemaFactory.java @@ -0,0 +1,45 @@ +/* + * The MIT License + * + * Copyright 2023 sebastian. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package io.github.sebastiantoepfer.jsonschema; + +import io.github.sebastiantoepfer.jsonschema.spi.JsonSchemaFactory; +import jakarta.json.JsonValue; + +public final class FakeJsonSchemaFactory implements JsonSchemaFactory { + + @Override + public JsonSchema create(final JsonValue schema) { + return new JsonSchema() { + @Override + public Validator validator() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public JsonValue.ValueType getValueType() { + throw new UnsupportedOperationException("Not supported yet."); + } + }; + } +} diff --git a/api/src/test/java/io/github/sebastiantoepfer/jsonschema/InstanceTypeTest.java b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/InstanceTypeTest.java new file mode 100644 index 00000000..7a45e2f4 --- /dev/null +++ b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/InstanceTypeTest.java @@ -0,0 +1,75 @@ +/* + * The MIT License + * + * Copyright 2023 sebastian. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package io.github.sebastiantoepfer.jsonschema; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +import jakarta.json.Json; +import jakarta.json.JsonValue; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class InstanceTypeTest { + + @ParameterizedTest + @MethodSource("provideWithValidCombinations") + void should_be_true_if_instancetype_is_correct(final InstanceType instanceType, final JsonValue value) { + assertThat(instanceType.isInstance(value), is(true)); + } + + static Stream provideWithValidCombinations() { + return Stream.of( + Arguments.of(InstanceType.NULL, JsonValue.NULL), + Arguments.of(InstanceType.BOOLEAN, JsonValue.FALSE), + Arguments.of(InstanceType.BOOLEAN, JsonValue.TRUE), + Arguments.of(InstanceType.OBJECT, JsonValue.EMPTY_JSON_OBJECT), + Arguments.of(InstanceType.ARRAY, JsonValue.EMPTY_JSON_ARRAY), + Arguments.of(InstanceType.NUMBER, Json.createValue(23L)), + Arguments.of(InstanceType.INTEGER, Json.createValue(23L)), + Arguments.of(InstanceType.INTEGER, Json.createValue(0.0)) + ); + } + + @ParameterizedTest + @MethodSource("provideWithInvalidCombinations") + void should_be_false_if_instancetype_is_correct(final InstanceType instanceType, final JsonValue value) { + assertThat(instanceType.isInstance(value), is(false)); + } + + static Stream provideWithInvalidCombinations() { + return Stream.of( + Arguments.of(InstanceType.NULL, JsonValue.TRUE), + Arguments.of(InstanceType.BOOLEAN, JsonValue.EMPTY_JSON_OBJECT), + Arguments.of(InstanceType.BOOLEAN, JsonValue.EMPTY_JSON_ARRAY), + Arguments.of(InstanceType.OBJECT, JsonValue.EMPTY_JSON_ARRAY), + Arguments.of(InstanceType.ARRAY, JsonValue.TRUE), + Arguments.of(InstanceType.NUMBER, Json.createValue("string")), + Arguments.of(InstanceType.INTEGER, Json.createValue(23.2)), + Arguments.of(InstanceType.INTEGER, Json.createValue("test")) + ); + } +} diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/JsonSchemasTest.java b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/JsonSchemasTest.java similarity index 96% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/JsonSchemasTest.java rename to api/src/test/java/io/github/sebastiantoepfer/jsonschema/JsonSchemasTest.java index aab4ad4c..49d64128 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/JsonSchemasTest.java +++ b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/JsonSchemasTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core; +package io.github.sebastiantoepfer.jsonschema; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/AnnotationTest.java b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/AnnotationTest.java similarity index 97% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/AnnotationTest.java rename to api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/AnnotationTest.java index e0967efc..a1998142 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/AnnotationTest.java +++ b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/AnnotationTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/ApplicatorTest.java b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/ApplicatorTest.java similarity index 97% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/ApplicatorTest.java rename to api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/ApplicatorTest.java index 0d7b786e..85a2aabd 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/ApplicatorTest.java +++ b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/ApplicatorTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/AssertionTest.java b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/AssertionTest.java similarity index 97% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/AssertionTest.java rename to api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/AssertionTest.java index 1a354692..63322eb5 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/AssertionTest.java +++ b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/AssertionTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/DefaultAnnotationTest.java b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/DefaultAnnotationTest.java similarity index 96% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/DefaultAnnotationTest.java rename to api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/DefaultAnnotationTest.java index 753d1796..775cbb66 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/DefaultAnnotationTest.java +++ b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/DefaultAnnotationTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/IdentifierTest.java b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/IdentifierTest.java similarity index 94% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/IdentifierTest.java rename to api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/IdentifierTest.java index cd492ea8..36085e82 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/IdentifierTest.java +++ b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/IdentifierTest.java @@ -21,12 +21,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword.KeywordCategory; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword.KeywordCategory; import java.net.URI; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/KeywordTypeTest.java b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/KeywordTypeTest.java similarity index 96% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/KeywordTypeTest.java rename to api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/KeywordTypeTest.java index 6a3d95df..028e7290 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/KeywordTypeTest.java +++ b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/KeywordTypeTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/ReservedLocationTest.java b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/ReservedLocationTest.java similarity index 97% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/ReservedLocationTest.java rename to api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/ReservedLocationTest.java index a85dbc02..22cca4aa 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/keyword/ReservedLocationTest.java +++ b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/keyword/ReservedLocationTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.keyword; +package io.github.sebastiantoepfer.jsonschema.keyword; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; diff --git a/api/src/test/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.spi.JsonSchemaFactory b/api/src/test/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.spi.JsonSchemaFactory new file mode 100644 index 00000000..78479819 --- /dev/null +++ b/api/src/test/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.spi.JsonSchemaFactory @@ -0,0 +1 @@ +io.github.sebastiantoepfer.jsonschema.FakeJsonSchemaFactory diff --git a/core/pom.xml b/core/pom.xml index 715ee569..2300dc22 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -13,6 +13,17 @@ Json Schema :: core + + ${project.groupId} + json-schema-api + ${project.version} + + + ${project.groupId} + json-schema-vocabulary-spi + ${project.version} + + org.junit.jupiter junit-jupiter-api diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/AbstractJsonValueSchema.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/AbstractJsonValueSchema.java similarity index 93% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/AbstractJsonValueSchema.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/AbstractJsonValueSchema.java index 2f92fa8c..09a7ea53 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/AbstractJsonValueSchema.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/AbstractJsonValueSchema.java @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; -import io.github.sebastiantoepfer.jsonschema.core.JsonSchema; +import io.github.sebastiantoepfer.jsonschema.JsonSchema; import jakarta.json.JsonArray; import jakarta.json.JsonObject; import jakarta.json.JsonValue; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultJsonSchema.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/DefaultJsonSchema.java similarity index 82% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultJsonSchema.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/DefaultJsonSchema.java index a9a7ffe1..ebe4f145 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultJsonSchema.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/DefaultJsonSchema.java @@ -21,17 +21,17 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; import static java.util.stream.Collectors.collectingAndThen; import static java.util.stream.Collectors.toList; -import io.github.sebastiantoepfer.jsonschema.core.Validator; -import io.github.sebastiantoepfer.jsonschema.core.impl.constraint.AllOfConstraint; -import io.github.sebastiantoepfer.jsonschema.core.impl.constraint.Constraint; -import io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core.VocabularyKeywordType; -import io.github.sebastiantoepfer.jsonschema.core.vocab.spi.VocabularyDefinition; -import io.github.sebastiantoepfer.jsonschema.core.vocab.spi.VocabularyDefinitions; +import io.github.sebastiantoepfer.jsonschema.Validator; +import io.github.sebastiantoepfer.jsonschema.core.constraint.AllOfConstraint; +import io.github.sebastiantoepfer.jsonschema.core.constraint.Constraint; +import io.github.sebastiantoepfer.jsonschema.core.vocab.core.VocabularyKeywordType; +import io.github.sebastiantoepfer.jsonschema.vocabulary.spi.VocabularyDefinition; +import io.github.sebastiantoepfer.jsonschema.vocabulary.spi.VocabularyDefinitions; import jakarta.json.JsonObject; import jakarta.json.JsonValue; import java.util.Collection; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultJsonSchemaFactory.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/DefaultJsonSchemaFactory.java similarity index 89% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultJsonSchemaFactory.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/DefaultJsonSchemaFactory.java index 5b8ea7d5..49bf94c9 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultJsonSchemaFactory.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/DefaultJsonSchemaFactory.java @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; -import io.github.sebastiantoepfer.jsonschema.core.JsonSchema; -import io.github.sebastiantoepfer.jsonschema.core.spi.JsonSchemaFactory; +import io.github.sebastiantoepfer.jsonschema.JsonSchema; +import io.github.sebastiantoepfer.jsonschema.spi.JsonSchemaFactory; import jakarta.json.JsonValue; public final class DefaultJsonSchemaFactory implements JsonSchemaFactory { diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultValidator.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/DefaultValidator.java similarity index 85% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultValidator.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/DefaultValidator.java index 61890a42..62d35a2e 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultValidator.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/DefaultValidator.java @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; -import io.github.sebastiantoepfer.jsonschema.core.ConstraintViolation; -import io.github.sebastiantoepfer.jsonschema.core.Validator; -import io.github.sebastiantoepfer.jsonschema.core.impl.constraint.Constraint; +import io.github.sebastiantoepfer.jsonschema.ConstraintViolation; +import io.github.sebastiantoepfer.jsonschema.Validator; +import io.github.sebastiantoepfer.jsonschema.core.constraint.Constraint; import jakarta.json.JsonValue; import java.util.Collection; import java.util.Objects; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/EmptyJsonSchema.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/EmptyJsonSchema.java similarity index 87% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/EmptyJsonSchema.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/EmptyJsonSchema.java index 8db7d282..17a2e73b 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/EmptyJsonSchema.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/EmptyJsonSchema.java @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; -import io.github.sebastiantoepfer.jsonschema.core.Validator; -import io.github.sebastiantoepfer.jsonschema.core.impl.constraint.NoConstraint; +import io.github.sebastiantoepfer.jsonschema.Validator; +import io.github.sebastiantoepfer.jsonschema.core.constraint.NoConstraint; import jakarta.json.JsonValue; final class EmptyJsonSchema extends AbstractJsonValueSchema { diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/FalseJsonSchema.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/FalseJsonSchema.java similarity index 87% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/FalseJsonSchema.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/FalseJsonSchema.java index 48b4eaa8..eee71fe6 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/FalseJsonSchema.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/FalseJsonSchema.java @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; -import io.github.sebastiantoepfer.jsonschema.core.Validator; -import io.github.sebastiantoepfer.jsonschema.core.impl.constraint.UnfulfillableConstraint; +import io.github.sebastiantoepfer.jsonschema.Validator; +import io.github.sebastiantoepfer.jsonschema.core.constraint.UnfulfillableConstraint; import jakarta.json.JsonValue; final class FalseJsonSchema extends AbstractJsonValueSchema { diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/KeywordSearch.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/KeywordSearch.java similarity index 88% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/KeywordSearch.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/KeywordSearch.java index 0b216ab2..5c5c9325 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/KeywordSearch.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/KeywordSearch.java @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import jakarta.json.JsonObject; import java.util.Objects; import java.util.Optional; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/Keywords.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/Keywords.java similarity index 86% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/Keywords.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/Keywords.java index 6f747e0d..eb8a6d2d 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/Keywords.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/Keywords.java @@ -21,16 +21,16 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; import static java.util.function.Predicate.not; import static java.util.stream.Collectors.toMap; -import io.github.sebastiantoepfer.jsonschema.core.Vocabulary; -import io.github.sebastiantoepfer.jsonschema.core.impl.vocab.basic.BasicVocabulary; -import io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core.CoreVocabulary; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; -import io.github.sebastiantoepfer.jsonschema.core.vocab.spi.VocabularyDefinition; +import io.github.sebastiantoepfer.jsonschema.Vocabulary; +import io.github.sebastiantoepfer.jsonschema.core.vocab.basic.BasicVocabulary; +import io.github.sebastiantoepfer.jsonschema.core.vocab.core.CoreVocabulary; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.vocabulary.spi.VocabularyDefinition; import jakarta.json.JsonValue; import java.net.URI; import java.util.ArrayDeque; @@ -44,7 +44,7 @@ final class Keywords { - public static final Map MANDANTORY_VOCABS; + private static final Map MANDANTORY_VOCABS; static { MANDANTORY_VOCABS = diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/TrueJsonSchema.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/TrueJsonSchema.java similarity index 87% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/TrueJsonSchema.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/TrueJsonSchema.java index aae77a7e..8cc4b777 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/TrueJsonSchema.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/TrueJsonSchema.java @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; -import io.github.sebastiantoepfer.jsonschema.core.Validator; -import io.github.sebastiantoepfer.jsonschema.core.impl.constraint.NoConstraint; +import io.github.sebastiantoepfer.jsonschema.Validator; +import io.github.sebastiantoepfer.jsonschema.core.constraint.NoConstraint; import jakarta.json.JsonValue; final class TrueJsonSchema extends AbstractJsonValueSchema { diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/AllOfConstraint.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/AllOfConstraint.java similarity index 93% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/AllOfConstraint.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/AllOfConstraint.java index 9f661b0c..657b557a 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/AllOfConstraint.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/AllOfConstraint.java @@ -21,12 +21,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.constraint; +package io.github.sebastiantoepfer.jsonschema.core.constraint; import static java.util.Arrays.asList; import static java.util.function.Predicate.not; -import io.github.sebastiantoepfer.jsonschema.core.ConstraintViolation; +import io.github.sebastiantoepfer.jsonschema.ConstraintViolation; import java.util.Collection; import java.util.List; import java.util.Set; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/AnyConstraint.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/AnyConstraint.java similarity index 94% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/AnyConstraint.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/AnyConstraint.java index cdf54e83..e4454126 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/AnyConstraint.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/AnyConstraint.java @@ -21,12 +21,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.constraint; +package io.github.sebastiantoepfer.jsonschema.core.constraint; import static java.util.Arrays.asList; import static java.util.stream.Collectors.toSet; -import io.github.sebastiantoepfer.jsonschema.core.ConstraintViolation; +import io.github.sebastiantoepfer.jsonschema.ConstraintViolation; import java.util.Collection; import java.util.List; import java.util.Set; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/Constraint.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/Constraint.java similarity index 90% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/Constraint.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/Constraint.java index 291d6b25..18bc877f 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/Constraint.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/Constraint.java @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.constraint; +package io.github.sebastiantoepfer.jsonschema.core.constraint; -import io.github.sebastiantoepfer.jsonschema.core.ConstraintViolation; +import io.github.sebastiantoepfer.jsonschema.ConstraintViolation; import java.util.Collection; public interface Constraint { diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/NoConstraint.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/NoConstraint.java similarity index 90% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/NoConstraint.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/NoConstraint.java index f3aebcf1..1c0ffc7d 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/NoConstraint.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/NoConstraint.java @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.constraint; +package io.github.sebastiantoepfer.jsonschema.core.constraint; -import io.github.sebastiantoepfer.jsonschema.core.ConstraintViolation; +import io.github.sebastiantoepfer.jsonschema.ConstraintViolation; import java.util.Collection; import java.util.Set; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/UnfulfillableConstraint.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/UnfulfillableConstraint.java similarity index 90% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/UnfulfillableConstraint.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/UnfulfillableConstraint.java index f351d498..78f27e04 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/constraint/UnfulfillableConstraint.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/constraint/UnfulfillableConstraint.java @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.constraint; +package io.github.sebastiantoepfer.jsonschema.core.constraint; -import io.github.sebastiantoepfer.jsonschema.core.ConstraintViolation; +import io.github.sebastiantoepfer.jsonschema.ConstraintViolation; import java.util.Collection; import java.util.Set; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/ConstraintAssertion.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/ConstraintAssertion.java similarity index 86% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/ConstraintAssertion.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/ConstraintAssertion.java index 9b39fb1a..8c01a472 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/ConstraintAssertion.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/ConstraintAssertion.java @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab; +package io.github.sebastiantoepfer.jsonschema.core.vocab; -import io.github.sebastiantoepfer.jsonschema.core.impl.constraint.Constraint; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Assertion; +import io.github.sebastiantoepfer.jsonschema.core.constraint.Constraint; +import io.github.sebastiantoepfer.jsonschema.keyword.Assertion; import jakarta.json.JsonValue; /** diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/BasicVocabulary.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/BasicVocabulary.java similarity index 89% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/BasicVocabulary.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/BasicVocabulary.java index a1ea76cb..decce0b8 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/BasicVocabulary.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/BasicVocabulary.java @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.basic; +package io.github.sebastiantoepfer.jsonschema.core.vocab.basic; -import io.github.sebastiantoepfer.jsonschema.core.Vocabulary; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.Vocabulary; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import java.net.URI; import java.util.Optional; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/TypeKeywordType.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/TypeKeywordType.java similarity index 88% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/TypeKeywordType.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/TypeKeywordType.java index 5ec17c60..c3ef73f4 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/TypeKeywordType.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/TypeKeywordType.java @@ -21,18 +21,18 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.basic; +package io.github.sebastiantoepfer.jsonschema.core.vocab.basic; import static java.util.stream.Collectors.collectingAndThen; import static java.util.stream.Collectors.toList; -import io.github.sebastiantoepfer.jsonschema.core.ConstraintViolation; -import io.github.sebastiantoepfer.jsonschema.core.InstanceType; -import io.github.sebastiantoepfer.jsonschema.core.impl.constraint.AnyConstraint; -import io.github.sebastiantoepfer.jsonschema.core.impl.constraint.Constraint; -import io.github.sebastiantoepfer.jsonschema.core.impl.vocab.ConstraintAssertion; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.ConstraintViolation; +import io.github.sebastiantoepfer.jsonschema.InstanceType; +import io.github.sebastiantoepfer.jsonschema.core.constraint.AnyConstraint; +import io.github.sebastiantoepfer.jsonschema.core.constraint.Constraint; +import io.github.sebastiantoepfer.jsonschema.core.vocab.ConstraintAssertion; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import jakarta.json.JsonArray; import jakarta.json.JsonString; import jakarta.json.JsonValue; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/UnknowKeywordType.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/UnknowKeywordType.java similarity index 84% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/UnknowKeywordType.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/UnknowKeywordType.java index 3fc2ff44..d3d86476 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/UnknowKeywordType.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/UnknowKeywordType.java @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.basic; +package io.github.sebastiantoepfer.jsonschema.core.vocab.basic; -import io.github.sebastiantoepfer.jsonschema.core.keyword.DefaultAnnotation; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.DefaultAnnotation; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import jakarta.json.JsonValue; import java.util.Objects; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/CommentKeywordType.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/CommentKeywordType.java similarity index 84% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/CommentKeywordType.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/CommentKeywordType.java index 4a82a7df..985f2922 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/CommentKeywordType.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/CommentKeywordType.java @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; -import io.github.sebastiantoepfer.jsonschema.core.keyword.DefaultAnnotation; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.DefaultAnnotation; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import jakarta.json.JsonValue; /** diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/CoreVocabulary.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/CoreVocabulary.java similarity index 91% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/CoreVocabulary.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/CoreVocabulary.java index efdbe6c9..33b7477e 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/CoreVocabulary.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/CoreVocabulary.java @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; -import io.github.sebastiantoepfer.jsonschema.core.Vocabulary; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.Vocabulary; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import java.net.URI; import java.util.Collection; import java.util.List; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/DefsKeywordType.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/DefsKeywordType.java similarity index 84% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/DefsKeywordType.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/DefsKeywordType.java index e2f4ddea..ed4e0d33 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/DefsKeywordType.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/DefsKeywordType.java @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; -import io.github.sebastiantoepfer.jsonschema.core.keyword.DefaultAnnotation; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.DefaultAnnotation; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import jakarta.json.JsonValue; /** diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/DynamicRefKeywordType.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/DynamicRefKeywordType.java similarity index 87% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/DynamicRefKeywordType.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/DynamicRefKeywordType.java index 02a228f3..390c58b4 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/DynamicRefKeywordType.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/DynamicRefKeywordType.java @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Applicator; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.Applicator; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import jakarta.json.JsonValue; import java.util.Objects; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/IdKeywordType.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/IdKeywordType.java similarity index 84% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/IdKeywordType.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/IdKeywordType.java index e9cdab24..6bf3fa21 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/IdKeywordType.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/IdKeywordType.java @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; -import io.github.sebastiantoepfer.jsonschema.core.keyword.DefaultAnnotation; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.DefaultAnnotation; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import jakarta.json.JsonValue; /** diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/LazyCoreVocabulary.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/LazyCoreVocabulary.java similarity index 89% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/LazyCoreVocabulary.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/LazyCoreVocabulary.java index d7719aea..82edca2e 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/LazyCoreVocabulary.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/LazyCoreVocabulary.java @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; -import io.github.sebastiantoepfer.jsonschema.core.Vocabulary; -import io.github.sebastiantoepfer.jsonschema.core.vocab.spi.LazyVocabularies; +import io.github.sebastiantoepfer.jsonschema.Vocabulary; +import io.github.sebastiantoepfer.jsonschema.vocabulary.spi.LazyVocabularies; import java.net.URI; import java.util.Objects; import java.util.Optional; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/RefKeywordType.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/RefKeywordType.java similarity index 87% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/RefKeywordType.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/RefKeywordType.java index 39785745..b59ba3a6 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/RefKeywordType.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/RefKeywordType.java @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Applicator; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.Applicator; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import jakarta.json.JsonValue; import java.util.Objects; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/SchemaKeywordType.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/SchemaKeywordType.java similarity index 84% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/SchemaKeywordType.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/SchemaKeywordType.java index 2e110175..926ec37c 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/SchemaKeywordType.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/SchemaKeywordType.java @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; -import io.github.sebastiantoepfer.jsonschema.core.keyword.DefaultAnnotation; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.DefaultAnnotation; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import jakarta.json.JsonValue; /** diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/VocabularyKeywordType.java b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/VocabularyKeywordType.java similarity index 88% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/VocabularyKeywordType.java rename to core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/VocabularyKeywordType.java index bd52fd79..2ff582e8 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/VocabularyKeywordType.java +++ b/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/VocabularyKeywordType.java @@ -21,13 +21,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; -import io.github.sebastiantoepfer.jsonschema.core.InstanceType; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; -import io.github.sebastiantoepfer.jsonschema.core.vocab.spi.VocabularyDefinition; -import io.github.sebastiantoepfer.jsonschema.core.vocab.spi.VocabularyDefinitions; +import io.github.sebastiantoepfer.jsonschema.InstanceType; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.vocabulary.spi.VocabularyDefinition; +import io.github.sebastiantoepfer.jsonschema.vocabulary.spi.VocabularyDefinitions; import jakarta.json.JsonObject; import jakarta.json.JsonValue; import java.net.URI; diff --git a/core/src/main/java/module-info.java b/core/src/main/java/module-info.java index beff4b69..1bcda2e5 100644 --- a/core/src/main/java/module-info.java +++ b/core/src/main/java/module-info.java @@ -22,13 +22,13 @@ * THE SOFTWARE. */ module io.github.sebastiantoepfer.jsonschema.core { - exports io.github.sebastiantoepfer.jsonschema.core; - exports io.github.sebastiantoepfer.jsonschema.core.keyword; - - exports io.github.sebastiantoepfer.jsonschema.core.vocab.spi; + requires io.github.sebastiantoepfer.jsonschema; + requires io.github.sebastiantoepfer.jsonschema.vocabulary.spi; + requires jakarta.json; - provides io.github.sebastiantoepfer.jsonschema.core.vocab.spi.LazyVocabularies - with io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core.LazyCoreVocabulary; + provides io.github.sebastiantoepfer.jsonschema.spi.JsonSchemaFactory + with io.github.sebastiantoepfer.jsonschema.core.DefaultJsonSchemaFactory; - requires jakarta.json; + provides io.github.sebastiantoepfer.jsonschema.vocabulary.spi.LazyVocabularies + with io.github.sebastiantoepfer.jsonschema.core.vocab.core.LazyCoreVocabulary; } diff --git a/core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.core.spi.JsonSchemaFactory b/core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.core.spi.JsonSchemaFactory deleted file mode 100644 index b2dd1495..00000000 --- a/core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.core.spi.JsonSchemaFactory +++ /dev/null @@ -1 +0,0 @@ -io.github.sebastiantoepfer.jsonschema.core.impl.spi.DefaultJsonSchemaFactory diff --git a/core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.core.vocab.spi.LazyVocabularies b/core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.core.vocab.spi.LazyVocabularies deleted file mode 100644 index 6e2e70b1..00000000 --- a/core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.core.vocab.spi.LazyVocabularies +++ /dev/null @@ -1 +0,0 @@ -io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core.LazyCoreVocabulary diff --git a/core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.spi.JsonSchemaFactory b/core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.spi.JsonSchemaFactory new file mode 100644 index 00000000..f38f8f8b --- /dev/null +++ b/core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.spi.JsonSchemaFactory @@ -0,0 +1 @@ +io.github.sebastiantoepfer.jsonschema.core.DefaultJsonSchemaFactory diff --git a/core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.vocabulary.spi.LazyVocabularies b/core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.vocabulary.spi.LazyVocabularies new file mode 100644 index 00000000..68cddf8a --- /dev/null +++ b/core/src/main/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.vocabulary.spi.LazyVocabularies @@ -0,0 +1 @@ +io.github.sebastiantoepfer.jsonschema.core.vocab.core.LazyCoreVocabulary diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/AbstractJsonValueSchemaTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/AbstractJsonValueSchemaTest.java similarity index 88% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/AbstractJsonValueSchemaTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/AbstractJsonValueSchemaTest.java index 7b31aff2..b660641b 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/AbstractJsonValueSchemaTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/AbstractJsonValueSchemaTest.java @@ -21,14 +21,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.is; -import io.github.sebastiantoepfer.jsonschema.core.Validator; -import io.github.sebastiantoepfer.jsonschema.core.impl.spi.AbstractJsonValueSchema; +import io.github.sebastiantoepfer.jsonschema.Validator; import jakarta.json.JsonArray; import jakarta.json.JsonObject; import jakarta.json.JsonValue; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultJsonSchemaFactoryTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/DefaultJsonSchemaFactoryTest.java similarity index 97% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultJsonSchemaFactoryTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/DefaultJsonSchemaFactoryTest.java index 6f32bd25..bab69f66 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultJsonSchemaFactoryTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/DefaultJsonSchemaFactoryTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.instanceOf; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultJsonSchemaTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/DefaultJsonSchemaTest.java similarity index 97% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultJsonSchemaTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/DefaultJsonSchemaTest.java index d94a2bfc..e0e3ac5b 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/DefaultJsonSchemaTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/DefaultJsonSchemaTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.empty; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/EmptyJsonSchemaTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/EmptyJsonSchemaTest.java similarity index 96% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/EmptyJsonSchemaTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/EmptyJsonSchemaTest.java index 4696b9cf..657e981b 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/EmptyJsonSchemaTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/EmptyJsonSchemaTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.empty; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/FalseJsonSchemaTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/FalseJsonSchemaTest.java similarity index 96% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/FalseJsonSchemaTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/FalseJsonSchemaTest.java index f44f9256..9819fcf6 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/FalseJsonSchemaTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/FalseJsonSchemaTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.empty; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/JsonValuesArguments.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/JsonValuesArguments.java similarity index 96% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/JsonValuesArguments.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/JsonValuesArguments.java index 49a51704..13c5a4a2 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/JsonValuesArguments.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/JsonValuesArguments.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; import jakarta.json.JsonValue; import java.util.stream.Stream; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/KeywordsTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/KeywordsTest.java similarity index 89% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/KeywordsTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/KeywordsTest.java index c8ffda57..1945fda6 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/KeywordsTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/KeywordsTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -29,9 +29,9 @@ import static org.hamcrest.Matchers.nullValue; import static org.junit.jupiter.api.Assertions.assertThrows; -import io.github.sebastiantoepfer.jsonschema.core.impl.vocab.basic.BasicVocabulary; -import io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core.CoreVocabulary; -import io.github.sebastiantoepfer.jsonschema.core.vocab.spi.VocabularyDefinition; +import io.github.sebastiantoepfer.jsonschema.core.vocab.basic.BasicVocabulary; +import io.github.sebastiantoepfer.jsonschema.core.vocab.core.CoreVocabulary; +import io.github.sebastiantoepfer.jsonschema.vocabulary.spi.VocabularyDefinition; import java.net.URI; import java.util.Collection; import java.util.List; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/TrueJsonSchemaTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/TrueJsonSchemaTest.java similarity index 96% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/TrueJsonSchemaTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/TrueJsonSchemaTest.java index 939e0ca7..36f5ff5b 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/spi/TrueJsonSchemaTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/TrueJsonSchemaTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.spi; +package io.github.sebastiantoepfer.jsonschema.core; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.empty; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/testsuite/JsonTestSuiteTestCaseProvider.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/testsuite/JsonTestSuiteTestCaseProvider.java index 914616fb..0656f74c 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/testsuite/JsonTestSuiteTestCaseProvider.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/testsuite/JsonTestSuiteTestCaseProvider.java @@ -23,7 +23,7 @@ */ package io.github.sebastiantoepfer.jsonschema.core.testsuite; -import io.github.sebastiantoepfer.jsonschema.core.JsonSchemas; +import io.github.sebastiantoepfer.jsonschema.JsonSchemas; import jakarta.json.Json; import jakarta.json.JsonObject; import jakarta.json.JsonValue; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/ConstraintAssertionTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/ConstraintAssertionTest.java similarity index 89% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/ConstraintAssertionTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/ConstraintAssertionTest.java index 7c4b52af..6561f6cd 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/ConstraintAssertionTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/ConstraintAssertionTest.java @@ -21,13 +21,14 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab; +package io.github.sebastiantoepfer.jsonschema.core.vocab; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import io.github.sebastiantoepfer.jsonschema.core.ConstraintViolation; -import io.github.sebastiantoepfer.jsonschema.core.impl.constraint.Constraint; +import io.github.sebastiantoepfer.jsonschema.ConstraintViolation; +import io.github.sebastiantoepfer.jsonschema.core.constraint.Constraint; +import io.github.sebastiantoepfer.jsonschema.core.vocab.ConstraintAssertion; import jakarta.json.JsonValue; import java.util.Collection; import java.util.Objects; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/BasicVocabularyTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/BasicVocabularyTest.java similarity index 91% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/BasicVocabularyTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/BasicVocabularyTest.java index 260772a6..75962d00 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/BasicVocabularyTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/BasicVocabularyTest.java @@ -21,13 +21,14 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.basic; +package io.github.sebastiantoepfer.jsonschema.core.vocab.basic; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import com.github.npathai.hamcrestopt.OptionalMatchers; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.core.vocab.basic.BasicVocabulary; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import jakarta.json.JsonValue; import java.net.URI; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/TypeTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/TypeTest.java similarity index 93% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/TypeTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/TypeTest.java index 12ddb326..88fcd282 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/basic/TypeTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/basic/TypeTest.java @@ -21,12 +21,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.basic; +package io.github.sebastiantoepfer.jsonschema.core.vocab.basic; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Assertion; +import io.github.sebastiantoepfer.jsonschema.core.vocab.basic.TypeKeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.Assertion; import jakarta.json.Json; import jakarta.json.JsonValue; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/CoreVocabularyTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/CoreVocabularyTest.java similarity index 94% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/CoreVocabularyTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/CoreVocabularyTest.java index 2b8febe9..392e842e 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/CoreVocabularyTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/CoreVocabularyTest.java @@ -21,12 +21,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import com.github.npathai.hamcrestopt.OptionalMatchers; +import io.github.sebastiantoepfer.jsonschema.core.vocab.core.CoreVocabulary; import jakarta.json.JsonValue; import java.net.URI; import org.junit.jupiter.params.ParameterizedTest; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/DynamicRefKeywordTypeTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/DynamicRefKeywordTypeTest.java similarity index 88% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/DynamicRefKeywordTypeTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/DynamicRefKeywordTypeTest.java index 3f3cd474..4a6dfb94 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/DynamicRefKeywordTypeTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/DynamicRefKeywordTypeTest.java @@ -21,12 +21,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.core.vocab.core.DynamicRefKeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; import jakarta.json.JsonValue; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/InstanceTypeTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/LazyCoreVocabularyTest.java similarity index 51% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/InstanceTypeTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/LazyCoreVocabularyTest.java index 576f459f..5f1aed0e 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/InstanceTypeTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/LazyCoreVocabularyTest.java @@ -21,36 +21,30 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; +import static com.github.npathai.hamcrestopt.OptionalMatchers.isEmpty; +import static com.github.npathai.hamcrestopt.OptionalMatchers.isPresentAndIs; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import jakarta.json.Json; -import jakarta.json.JsonValue; +import io.github.sebastiantoepfer.jsonschema.Vocabulary; +import java.net.URI; import org.junit.jupiter.api.Test; -class InstanceTypeTest { +class LazyCoreVocabularyTest { @Test - void should_be_true_if_instancetype_is_correct() { - assertThat(InstanceType.NULL.isInstance(JsonValue.NULL), is(true)); - assertThat(InstanceType.BOOLEAN.isInstance(JsonValue.FALSE), is(true)); - assertThat(InstanceType.BOOLEAN.isInstance(JsonValue.TRUE), is(true)); - assertThat(InstanceType.OBJECT.isInstance(JsonValue.EMPTY_JSON_OBJECT), is(true)); - assertThat(InstanceType.ARRAY.isInstance(JsonValue.EMPTY_JSON_ARRAY), is(true)); - assertThat(InstanceType.NUMBER.isInstance(Json.createValue(23L)), is(true)); - assertThat(InstanceType.INTEGER.isInstance(Json.createValue(23L)), is(true)); - assertThat(InstanceType.INTEGER.isInstance(Json.createValue(0.0)), is(true)); + void should_return_empty_for_non_core_id() { + assertThat(new LazyCoreVocabulary().loadVocabularyWithId(URI.create("")), isEmpty()); } @Test - void should_be_false_for_non_integers() { - assertThat(InstanceType.INTEGER.isInstance(Json.createValue(23.2)), is(false)); - } - - @Test - void should_be_false_for_nonnumbers() { - assertThat(InstanceType.INTEGER.isInstance(Json.createValue("test")), is(false)); + void should_return_core_vocabulary_for_core_id() { + assertThat( + new LazyCoreVocabulary() + .loadVocabularyWithId(URI.create("https://json-schema.org/draft/2020-12/vocab/core")) + .map(Vocabulary::id), + isPresentAndIs(URI.create("https://json-schema.org/draft/2020-12/vocab/core")) + ); } } diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/RefKeywordTypeTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/RefKeywordTypeTest.java similarity index 89% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/RefKeywordTypeTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/RefKeywordTypeTest.java index db079cb3..345da416 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/RefKeywordTypeTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/RefKeywordTypeTest.java @@ -21,12 +21,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.core.vocab.core.RefKeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; import jakarta.json.JsonValue; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/VocabularyKeywordTypeTest.java b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/VocabularyKeywordTypeTest.java similarity index 89% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/VocabularyKeywordTypeTest.java rename to core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/VocabularyKeywordTypeTest.java index 5772ce28..45923f04 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/impl/vocab/core/VocabularyKeywordTypeTest.java +++ b/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/core/VocabularyKeywordTypeTest.java @@ -21,15 +21,16 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.impl.vocab.core; +package io.github.sebastiantoepfer.jsonschema.core.vocab.core; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.is; -import io.github.sebastiantoepfer.jsonschema.core.keyword.Keyword; -import io.github.sebastiantoepfer.jsonschema.core.vocab.spi.VocabularyDefinition; -import io.github.sebastiantoepfer.jsonschema.core.vocab.spi.VocabularyDefinitions; +import io.github.sebastiantoepfer.jsonschema.core.vocab.core.VocabularyKeywordType; +import io.github.sebastiantoepfer.jsonschema.keyword.Keyword; +import io.github.sebastiantoepfer.jsonschema.vocabulary.spi.VocabularyDefinition; +import io.github.sebastiantoepfer.jsonschema.vocabulary.spi.VocabularyDefinitions; import jakarta.json.Json; import jakarta.json.JsonValue; import java.net.URI; diff --git a/core/src/test/java/module-info.java b/core/src/test/java/module-info.java index d1eae398..b7ce75fd 100644 --- a/core/src/test/java/module-info.java +++ b/core/src/test/java/module-info.java @@ -22,6 +22,8 @@ * THE SOFTWARE. */ open module io.github.sebastiantoepfer.jsonschema.core { + requires io.github.sebastiantoepfer.jsonschema; + requires io.github.sebastiantoepfer.jsonschema.vocabulary.spi; requires jakarta.json; requires org.junit.jupiter.api; diff --git a/core/src/test/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.testsuite.junit.SchemaTestValidatorLoader b/core/src/test/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.testsuite.junit.SchemaTestValidatorLoader deleted file mode 100644 index eb2d5163..00000000 --- a/core/src/test/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.testsuite.junit.SchemaTestValidatorLoader +++ /dev/null @@ -1 +0,0 @@ -io.github.sebastiantoepfer.jsonschema.core.testsuite.JsonSchemaSchemaTestValidatorAdapterLoader diff --git a/pom.xml b/pom.xml index f8d0afb6..d16ec52d 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,9 @@ testsuite-junit-platform-engine - core + api + vocabulary-spi + core diff --git a/vocabulary-spi/pom.xml b/vocabulary-spi/pom.xml new file mode 100644 index 00000000..e3227436 --- /dev/null +++ b/vocabulary-spi/pom.xml @@ -0,0 +1,46 @@ + + + + 4.0.0 + + + io.github.sebastian-toepfer.json-schema + json-schema + 0.1.0-SNAPSHOT + + + json-schema-vocabulary-spi + Json Schema :: vocabulary :: spi + + + + ${project.groupId} + json-schema-api + ${project.version} + + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + + org.hamcrest + hamcrest + test + + + com.github.npathai + hamcrest-optional + test + + + diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/LazyVocabularies.java b/vocabulary-spi/src/main/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/LazyVocabularies.java similarity index 91% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/LazyVocabularies.java rename to vocabulary-spi/src/main/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/LazyVocabularies.java index 44e97301..05d7fd67 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/LazyVocabularies.java +++ b/vocabulary-spi/src/main/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/LazyVocabularies.java @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.vocab.spi; +package io.github.sebastiantoepfer.jsonschema.vocabulary.spi; -import io.github.sebastiantoepfer.jsonschema.core.Vocabulary; +import io.github.sebastiantoepfer.jsonschema.Vocabulary; import java.net.URI; import java.util.Optional; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/VocabularyDefinition.java b/vocabulary-spi/src/main/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/VocabularyDefinition.java similarity index 93% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/VocabularyDefinition.java rename to vocabulary-spi/src/main/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/VocabularyDefinition.java index 667b4b9b..0d4ab838 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/VocabularyDefinition.java +++ b/vocabulary-spi/src/main/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/VocabularyDefinition.java @@ -21,9 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.vocab.spi; +package io.github.sebastiantoepfer.jsonschema.vocabulary.spi; -import io.github.sebastiantoepfer.jsonschema.core.Vocabulary; +import io.github.sebastiantoepfer.jsonschema.Vocabulary; import java.net.URI; import java.util.Optional; import java.util.ServiceLoader; diff --git a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/VocabularyDefinitions.java b/vocabulary-spi/src/main/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/VocabularyDefinitions.java similarity index 95% rename from core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/VocabularyDefinitions.java rename to vocabulary-spi/src/main/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/VocabularyDefinitions.java index af904b01..fe9dd85f 100644 --- a/core/src/main/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/VocabularyDefinitions.java +++ b/vocabulary-spi/src/main/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/VocabularyDefinitions.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.vocab.spi; +package io.github.sebastiantoepfer.jsonschema.vocabulary.spi; import java.util.stream.Stream; diff --git a/vocabulary-spi/src/main/java/module-info.java b/vocabulary-spi/src/main/java/module-info.java new file mode 100644 index 00000000..68e99b3f --- /dev/null +++ b/vocabulary-spi/src/main/java/module-info.java @@ -0,0 +1,29 @@ +/* + * The MIT License + * + * Copyright 2023 sebastian. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module io.github.sebastiantoepfer.jsonschema.vocabulary.spi { + exports io.github.sebastiantoepfer.jsonschema.vocabulary.spi; + + requires io.github.sebastiantoepfer.jsonschema; +} diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/LazyVocabulariesTest.java b/vocabulary-spi/src/test/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/LazyVocabulariesTest.java similarity index 92% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/LazyVocabulariesTest.java rename to vocabulary-spi/src/test/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/LazyVocabulariesTest.java index 332ce93c..fb7f777b 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/LazyVocabulariesTest.java +++ b/vocabulary-spi/src/test/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/LazyVocabulariesTest.java @@ -21,13 +21,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.vocab.spi; +package io.github.sebastiantoepfer.jsonschema.vocabulary.spi; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import io.github.sebastiantoepfer.jsonschema.core.Vocabulary; -import io.github.sebastiantoepfer.jsonschema.core.keyword.KeywordType; +import io.github.sebastiantoepfer.jsonschema.Vocabulary; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; import java.net.URI; import java.util.Objects; import java.util.Optional; diff --git a/vocabulary-spi/src/test/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/TestLazyVocabularies.java b/vocabulary-spi/src/test/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/TestLazyVocabularies.java new file mode 100644 index 00000000..e9efbd88 --- /dev/null +++ b/vocabulary-spi/src/test/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/TestLazyVocabularies.java @@ -0,0 +1,53 @@ +/* + * The MIT License + * + * Copyright 2023 sebastian. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package io.github.sebastiantoepfer.jsonschema.vocabulary.spi; + +import io.github.sebastiantoepfer.jsonschema.Vocabulary; +import io.github.sebastiantoepfer.jsonschema.keyword.KeywordType; +import java.net.URI; +import java.util.Optional; + +public final class TestLazyVocabularies implements LazyVocabularies { + + @Override + public Optional loadVocabularyWithId(final URI id) { + if (id.equals(URI.create("https://json-schema.org/draft/2020-12/vocab/core"))) { + return Optional.of( + new Vocabulary() { + @Override + public URI id() { + return id; + } + + @Override + public Optional findKeywordTypeByName(String name) { + return Optional.empty(); + } + } + ); + } else { + return Optional.empty(); + } + } +} diff --git a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/VocabularyDefinitionTest.java b/vocabulary-spi/src/test/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/VocabularyDefinitionTest.java similarity index 95% rename from core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/VocabularyDefinitionTest.java rename to vocabulary-spi/src/test/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/VocabularyDefinitionTest.java index 7e096d93..dd582c88 100644 --- a/core/src/test/java/io/github/sebastiantoepfer/jsonschema/core/vocab/spi/VocabularyDefinitionTest.java +++ b/vocabulary-spi/src/test/java/io/github/sebastiantoepfer/jsonschema/vocabulary/spi/VocabularyDefinitionTest.java @@ -21,14 +21,14 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package io.github.sebastiantoepfer.jsonschema.core.vocab.spi; +package io.github.sebastiantoepfer.jsonschema.vocabulary.spi; import static com.github.npathai.hamcrestopt.OptionalMatchers.isEmpty; import static com.github.npathai.hamcrestopt.OptionalMatchers.isPresentAndIs; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import io.github.sebastiantoepfer.jsonschema.core.Vocabulary; +import io.github.sebastiantoepfer.jsonschema.Vocabulary; import java.net.URI; import org.junit.jupiter.api.Test; diff --git a/vocabulary-spi/src/test/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.vocabulary.spi.LazyVocabularies b/vocabulary-spi/src/test/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.vocabulary.spi.LazyVocabularies new file mode 100644 index 00000000..7f7bf604 --- /dev/null +++ b/vocabulary-spi/src/test/resources/META-INF/services/io.github.sebastiantoepfer.jsonschema.vocabulary.spi.LazyVocabularies @@ -0,0 +1 @@ +io.github.sebastiantoepfer.jsonschema.vocabulary.spi.TestLazyVocabularies