com.github.erosb.jsonsKema.Items.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 ItemsSchema(val itemsSchema: Schema, val prefixItemCount: Int, override val location: SourceLocation) : Schema(location) {
override fun accept(visitor: SchemaVisitor
): P? = visitor.visitItemsSchema(this)
override fun subschemas(): Collection = listOf(itemsSchema)
}
internal val itemsSchemaLoader: KeywordLoader = { ctx ->
ItemsSchema(
ctx.subschemaLoader(ctx.keywordValue),
ctx.containingObject[Keyword.PREFIX_ITEMS.value]?.maybeArray { it.length() } ?: 0,
ctx.location
)
}
data class ItemsValidationFailure(
val itemFailures: Map,
override val schema: ItemsSchema,
override val instance: IJsonArray<*>
) : ValidationFailure(
"array items ${itemFailures.keys.joinToString(", ")} failed to validate against \"items\" subschema",
schema,
instance,
Keyword.ITEMS,
itemFailures.values.toSet()
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy