com.github.erosb.jsonsKema.Enum.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
class EnumSchema(val potentialValues: Collection, override val location: SourceLocation) : Schema(location) {
override fun accept(visitor: SchemaVisitor
): P? = visitor.visitEnumSchema(this)
}
internal val enumLoader: KeywordLoader = { ctx ->
EnumSchema(ctx.keywordValue.requireArray().elements, ctx.location)
}
class EnumValidationFailure(
override val schema: EnumSchema,
override val instance: IJsonValue
) : ValidationFailure("the instance is not equal to any enum values", schema, instance, Keyword.ENUM)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy