pwall567 / json-kotlin-schema

Kotlin implementation of JSON Schema (Draft 07)
MIT License
88 stars 12 forks source link

Validation issues #19

Closed elect86 closed 6 months ago

elect86 commented 6 months ago

Schema and json here

Validation passes with online validator

fun main() {
    val dataset = File("/home/elect/Downloads/DATASETS.json").readText()

    val schema = JSONSchema.parseFile("/home/elect/Downloads/SCHEMA.json")
    println(schema.validate(dataset))
    val output = schema.validateBasic(dataset)
    output.errors?.forEach {
        println("${it.error}, ${it.instanceLocation}, ${it.keywordLocation}, ${it.absoluteKeywordLocation}")
    }
}

false A subschema had errors, #, #, file:/home/elect/Downloads/SCHEMA.json# Incorrect type, expected object, #, #/type, file:/home/elect/Downloads/SCHEMA.json#/type

elect86 commented 6 months ago

Sorry, my fault