commonMain.com.copperleaf.json.schema.JsonSchema.kt Maven / Gradle / Ivy
package com.copperleaf.json.schema
import com.copperleaf.json.pointer.JsonPointer
import kotlinx.serialization.json.JsonElement
public expect class JsonSchema(input: String) {
public fun validate(element: JsonElement): SchemaValidationResult
public companion object {
public fun parse(input: String): JsonSchema
}
}
public sealed class SchemaValidationResult(public val isValid: Boolean) {
public abstract fun issues(pointer: JsonPointer): List
public object Valid : SchemaValidationResult(true) {
public override fun issues(pointer: JsonPointer): List = emptyList()
}
public abstract class Invalid : SchemaValidationResult(false) {
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy