diff --git a/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/JsonSchemaLoader.kt b/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/JsonSchemaLoader.kt index ac248971..5e65aa97 100644 --- a/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/JsonSchemaLoader.kt +++ b/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/JsonSchemaLoader.kt @@ -48,7 +48,7 @@ public interface JsonSchemaLoader { @Deprecated( message = "This method will be removed in a future release. Please use the alternative that accepts Uri type", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, replaceWith = ReplaceWith( imports = ["com.eygraber.uri.Uri"], @@ -67,7 +67,7 @@ public interface JsonSchemaLoader { @Deprecated( message = "This method will be removed in a future release. Please use the alternative that accepts Uri type", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, replaceWith = ReplaceWith( imports = ["com.eygraber.uri.Uri"], diff --git a/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/extension/ExternalAssertion.kt b/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/extension/ExternalAssertion.kt index cfec4a6e..b48978e0 100644 --- a/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/extension/ExternalAssertion.kt +++ b/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/extension/ExternalAssertion.kt @@ -2,7 +2,6 @@ package io.github.optimumcode.json.schema.extension import io.github.optimumcode.json.schema.ErrorCollector import io.github.optimumcode.json.schema.ExperimentalApi -import io.github.optimumcode.json.schema.internal.wrapper.JsonWrapper import io.github.optimumcode.json.schema.model.AbstractElement import kotlinx.serialization.json.JsonElement @@ -36,24 +35,15 @@ public interface ExternalAssertion { element: AbstractElement, context: ExternalAssertionContext, errorCollector: ErrorCollector, - ): Boolean = - // TODO: remove it after two minor/major release - validate(element.unwrap(), context, errorCollector) + ): Boolean = throw NotImplementedError("please override the method in your implementation") - // TODO: increase level to error in the next release @Deprecated( message = "override validate(AbstractElement, ExternalAssertionContext, ErrorCollector) instead", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) public fun validate( element: JsonElement, context: ExternalAssertionContext, errorCollector: ErrorCollector, - ): Boolean = throw UnsupportedOperationException() -} - -internal fun AbstractElement.unwrap(): JsonElement = - when (this) { - is JsonWrapper -> unwrap() - else -> error("unsupported element type: ${this::class.simpleName}") - } \ No newline at end of file + ): Boolean = throw UnsupportedOperationException("please use validate method with AbstractElement parameter") +} \ No newline at end of file