jam01 / json-schema   0.1.0

Apache License 2.0 GitHub
Scala versions: 3.x
Scala.js versions: 1.x

JSON Schema Validator for Scala 3

Validation of JSON-like structures with JSON Schemas through upickle's visitor framework.

Usage

Example with ujson

val sch: Schema = json_schema.from(ujson.Readable, ujson.Readable.fromString("""{"type": "string"}"""))
val validator: Visitor[?, OutputUnit] = json_schema.validator(sch)
val result: OutputUnit = ujson.Str("foo").transform(validator)

Note: ujson is not a direct dependency of json-schema_3.

Dependency

sbt

libraryDependencies += "io.github.jam01" % "json-schema_3" % "0.1.0"

Mill

ivy"io.github.jam01::json-schema_3::0.1.0"

Maven

<dependency>
    <groupId>io.github.jam01</groupId>
    <artifactId>json-schema_3</artifactId>
    <version>0.1.0</version>
</dependency>