com.github.erosb.jsonsKema.DependentSchemas.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 DependentSchemasSchema(
val dependentSchemas: Map,
override val location: SourceLocation
) : Schema(location) {
override fun accept(visitor: SchemaVisitor
): P? = visitor.visitDependentSchemas(this)
}
internal val dependentSchemasLoader: KeywordLoader = { ctx ->
DependentSchemasSchema(
ctx.keywordValue.requireObject().properties
.mapKeys { it.key.value }
.mapValues { ctx.subschemaLoader(it.value) },
ctx.location
)
}
data class DependentSchemasValidationFailure(
override val schema: DependentSchemasSchema,
override val instance: IJsonValue,
val causesByProperty: Map
) : ValidationFailure(
message = "some dependent subschemas did not match",
schema = schema,
instance = instance,
keyword = Keyword.DEPENDENT_SCHEMAS,
causes = causesByProperty.values.toSet()
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy