Skip to content

Commit 118f6f8

Browse files
committed
Add experimental api annotation for model classes
1 parent 539f36a commit 118f6f8

File tree

1 file changed

+6
-0
lines changed
  • json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/model

1 file changed

+6
-0
lines changed

json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/model/Model.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
package io.github.optimumcode.json.schema.model
22

3+
import io.github.optimumcode.json.schema.ExperimentalApi
4+
35
/**
46
* [AbstractElement] represents one of 3 elements that can be consumed and validated:
57
* * [ObjectElement] - corresponds to a JSON/YAML object or [Map]
68
* * [ArrayElement] - corresponds to a collection of [AbstractElement]s
79
* * [PrimitiveElement] - corresponds to a scalar value (string, number, boolean)
810
*/
11+
@ExperimentalApi
912
public sealed interface AbstractElement {
1013
/**
1114
* Implement [toString] method to provide a useful view that can be used in error message
1215
*/
1316
override fun toString(): String
1417
}
1518

19+
@ExperimentalApi
1620
public interface PrimitiveElement : AbstractElement {
1721
/**
1822
* Returns `true` if the element is `null`.
@@ -54,6 +58,7 @@ public interface PrimitiveElement : AbstractElement {
5458
internal val PrimitiveElement.contentOrNull: String?
5559
get() = if (isNull) null else content
5660

61+
@ExperimentalApi
5762
public interface ObjectElement : AbstractElement, Sequence<Pair<String, AbstractElement>> {
5863
/**
5964
* Returns the set of keys defined in the [ObjectElement]
@@ -80,6 +85,7 @@ public interface ObjectElement : AbstractElement, Sequence<Pair<String, Abstract
8085

8186
internal fun ObjectElement.isEmpty(): Boolean = size == 0
8287

88+
@ExperimentalApi
8389
public interface ArrayElement : AbstractElement, Sequence<AbstractElement> {
8490
/**
8591
* Returns the [AbstractElement] associated with the [index].

0 commit comments

Comments
 (0)