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

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

There is a newer version: 0.20.0
Show newest version
package com.github.erosb.jsonsKema

internal val additionalPropertiesLoader: KeywordLoader = { ctx ->
    val keysInProperties = ctx.containingObject["properties"]?.requireObject()
        ?.properties?.keys?.map { it.value } ?: listOf()
    val patternPropertyKeys = ctx.containingObject["patternProperties"]
        ?.requireObject()?.properties?.keys
        ?.map { ctx.regexpFactory.createHandler(it.value) }
        ?: emptyList()
    AdditionalPropertiesSchema(ctx.loadSubschema(), keysInProperties, patternPropertyKeys, ctx.location)
}

data class AdditionalPropertiesSchema(
    val subschema: Schema,
    val keysInProperties: List,
    val patternPropertyKeys: Collection,
    override val location: SourceLocation
) : Schema(location) {
    override fun 

accept(visitor: SchemaVisitor

) = visitor.visitAdditionalPropertiesSchema(this) override fun subschemas() = listOf(subschema) }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy