Skip to content

Commit fa31c41

Browse files
committed
Add README for new module
1 parent fcada9f commit fa31c41

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# JSON schema object wrapper
2+
3+
This module allows wrapping Kotlin objects (e.g. Map, List, primitives) to `AbstractElement` that can be validated by JSON schema.
4+
5+
## Usage
6+
7+
```kotlin
8+
val schema = JsonSchema.fromDefinition(/*schema*/)
9+
10+
val obj = mapOf(
11+
"a" to 42,
12+
"b" to listOf("test"),
13+
"c" to mapOf(
14+
"inner" to 42,
15+
),
16+
)
17+
18+
val result = schema.validate(wrapAsElement(obj), OutputCollector.flag())
19+
```

0 commit comments

Comments
 (0)