com.github.erosb.jsonsKema.MaxLength.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 MaxLengthSchema(val maxLength: Int, override val location: SourceLocation) : Schema(location) {
override fun accept(visitor: SchemaVisitor
) = visitor.visitMaxLengthSchema(this)
}
internal val maxLengthLoader: KeywordLoader = { ctx ->
MaxLengthSchema(ctx.keywordValue.requireInt(), ctx.location)
}
data class MaxLengthValidationFailure(
override val schema: MaxLengthSchema,
override val instance: IJsonString
) : ValidationFailure(
"actual string length ${instance.value.length} exceeds maxLength ${schema.maxLength}",
schema,
instance,
Keyword.MAX_LENGTH
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy