Skip to content

Commit a03e115

Browse files
authored
Increase deprecation level to warning (#252)
Resolves #228
1 parent 027c709 commit a03e115

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

Diff for: json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/JsonSchemaLoader.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public interface JsonSchemaLoader {
4848

4949
@Deprecated(
5050
message = "This method will be removed in a future release. Please use the alternative that accepts Uri type",
51-
level = DeprecationLevel.WARNING,
51+
level = DeprecationLevel.ERROR,
5252
replaceWith =
5353
ReplaceWith(
5454
imports = ["com.eygraber.uri.Uri"],
@@ -67,7 +67,7 @@ public interface JsonSchemaLoader {
6767

6868
@Deprecated(
6969
message = "This method will be removed in a future release. Please use the alternative that accepts Uri type",
70-
level = DeprecationLevel.WARNING,
70+
level = DeprecationLevel.ERROR,
7171
replaceWith =
7272
ReplaceWith(
7373
imports = ["com.eygraber.uri.Uri"],

Diff for: json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/extension/ExternalAssertion.kt

+4-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package io.github.optimumcode.json.schema.extension
22

33
import io.github.optimumcode.json.schema.ErrorCollector
44
import io.github.optimumcode.json.schema.ExperimentalApi
5-
import io.github.optimumcode.json.schema.internal.wrapper.JsonWrapper
65
import io.github.optimumcode.json.schema.model.AbstractElement
76
import kotlinx.serialization.json.JsonElement
87

@@ -36,24 +35,15 @@ public interface ExternalAssertion {
3635
element: AbstractElement,
3736
context: ExternalAssertionContext,
3837
errorCollector: ErrorCollector,
39-
): Boolean =
40-
// TODO: remove it after two minor/major release
41-
validate(element.unwrap(), context, errorCollector)
38+
): Boolean = throw NotImplementedError("please override the method in your implementation")
4239

43-
// TODO: increase level to error in the next release
4440
@Deprecated(
4541
message = "override validate(AbstractElement, ExternalAssertionContext, ErrorCollector) instead",
46-
level = DeprecationLevel.WARNING,
42+
level = DeprecationLevel.ERROR,
4743
)
4844
public fun validate(
4945
element: JsonElement,
5046
context: ExternalAssertionContext,
5147
errorCollector: ErrorCollector,
52-
): Boolean = throw UnsupportedOperationException()
53-
}
54-
55-
internal fun AbstractElement.unwrap(): JsonElement =
56-
when (this) {
57-
is JsonWrapper -> unwrap()
58-
else -> error("unsupported element type: ${this::class.simpleName}")
59-
}
48+
): Boolean = throw UnsupportedOperationException("please use validate method with AbstractElement parameter")
49+
}

0 commit comments

Comments
 (0)