com.github.erosb.jsonsKema.AnyOf.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-sKema Show documentation
Show all versions of json-sKema Show documentation
JSON Schema Parser and Validator
package com.github.erosb.jsonsKema
data class AnyOfSchema(
val subschemas: List,
override val location: SourceLocation
) : Schema(location) {
override fun accept(visitor: SchemaVisitor
) = visitor.visitAnyOfSchema(this)
override fun subschemas(): Collection = subschemas
}
internal val anyOfLoader: KeywordLoader = { ctx ->
AnyOfSchema(arrayToSubschemaList(ctx.keywordValue.requireArray(), ctx.subschemaLoader), ctx.location)
}
data class AnyOfValidationFailure(
override val schema: AnyOfSchema,
override val instance: IJsonValue,
override val causes: Set
) : ValidationFailure(
message = "no subschema out of ${schema.subschemas.size} matched",
schema = schema,
instance = instance,
causes = causes,
keyword = Keyword.ANY_OF
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy