All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.erosb.jsonsKema.Contains.kt Maven / Gradle / Ivy

The newest version!
package com.github.erosb.jsonsKema

data class ContainsSchema(
    val containedSchema: Schema,
    val minContains: Number = 1,
    val maxContains: Number?,
    override val location: SourceLocation
) : Schema(location) {
    override fun 

accept(visitor: SchemaVisitor

): P? = visitor.visitContainsSchema(this) override fun subschemas(): Collection = listOf(containedSchema) } internal val containsLoader: KeywordLoader = { ctx -> val minContains = ctx.containingObject[Keyword.MIN_CONTAINS.value]?.maybeNumber { it.value } ?: 1 val maxContains = ctx.containingObject[Keyword.MAX_CONTAINS.value]?.maybeNumber { it.value } ContainsSchema(ctx.subschemaLoader(ctx.keywordValue), minContains, maxContains, ctx.location) } data class ContainsValidationFailure( override val message: String, override val schema: ContainsSchema, override val instance: IJsonArray<*>, override val dynamicPath: JsonPointer ) : ValidationFailure( message, schema, instance, Keyword.CONTAINS )





© 2015 - 2025 Weber Informatics LLC | Privacy Policy