com.github.erosb.jsonsKema.Pattern.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
The newest version!
package com.github.erosb.jsonsKema
data class PatternSchema(
val pattern: Regexp,
override val location: SourceLocation
) : Schema(location) {
override fun accept(visitor: SchemaVisitor
): P? = visitor.visitPatternSchema(this)
}
internal val patternLoader: KeywordLoader = { ctx ->
PatternSchema(ctx.regexpFactory.createHandler(ctx.keywordValue.requireString().value), ctx.location)
}
data class PatternValidationFailure(
override val schema: PatternSchema,
override val instance: IJsonValue,
override val dynamicPath: JsonPointer
) : ValidationFailure(
message = "instance value did not match pattern ${schema.pattern}",
schema = schema,
instance = instance,
keyword = Keyword.PATTERN
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy