diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index cfef5efc..b63fa858 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -18,12 +18,13 @@ if (jdkVersion != System.getProperty("java.version")) { plugins { kotlin("jvm") version "1.9.22" + kotlin("plugin.serialization") version "1.9.22" // configured by `jvmWrapper` block below id("me.filippov.gradle.jvm.wrapper") version "0.14.0" } -// NOTE: `./gradlew wrapper` must be run for edit to this config to take effect +// NOTE: `./gradlew wrapper` must be run for edits to this config to take effect jvmWrapper { unixJvmInstallDir = jdkProperties.getProperty("unixJvmInstallDir") winJvmInstallDir = jdkProperties.getProperty("winJvmInstallDir") @@ -67,4 +68,5 @@ dependencies { implementation(gradleApi()) testImplementation(kotlin("test")) implementation("org.eclipse.jgit:org.eclipse.jgit:6.7.0.202309050840-r") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.1") } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/GenerateJsonTestSuiteTask.kt b/buildSrc/src/main/kotlin/GenerateJsonTestSuiteTask.kt index 0ac676c9..908de099 100644 --- a/buildSrc/src/main/kotlin/GenerateJsonTestSuiteTask.kt +++ b/buildSrc/src/main/kotlin/GenerateJsonTestSuiteTask.kt @@ -1,14 +1,18 @@ import org.gradle.api.DefaultTask import org.gradle.api.tasks.* +import org.kson.jsonsuite.JsonSuiteGitCheckout import org.kson.jsonsuite.JsonTestSuiteGenerator +import org.kson.jsonsuite.SchemaSuiteGitCheckout import java.io.File -import java.nio.file.Paths /** - * The Git SHA in the [JSONTestSuite](https://github.com/nst/JSONTestSuite) we currently test against. - * This can be updated if/when we want to pull in newer tests from that project. + * The Git SHAs in [JSONTestSuite](https://github.com/nst/JSONTestSuite) and [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) + * that we currently test against. + * + * These can be updated if/when we want to pull in newer tests from those projects. */ -private const val testSuiteSHA = "984defc2deaa653cb73cd29f4144a720ec9efe7c" +const val jsonTestSuiteSHA = "984defc2deaa653cb73cd29f4144a720ec9efe7c" +const val schemaTestSuiteSHA = "9fc880bfb6d8ccd093bc82431f17d13681ffae8e" /** * This task exposes [JsonTestSuiteGenerator] to our Gradle build, ensuring the task's @@ -17,33 +21,36 @@ private const val testSuiteSHA = "984defc2deaa653cb73cd29f4144a720ec9efe7c" * if/when the test at [getGeneratedTestPath] is deleted) */ open class GenerateJsonTestSuiteTask : DefaultTask() { - private val jsonTestSuiteGenerator = - JsonTestSuiteGenerator( - testSuiteSHA, - project.projectDir.toPath(), - Paths.get("src/commonTest/kotlin/"), + private val jsonTestSuiteGenerator: JsonTestSuiteGenerator + + init { + val projectRoot = project.projectDir.toPath() + val destinationDir = projectRoot.resolve("buildSrc").resolve("support/jsonsuite") + + val sourceRoot = projectRoot.resolve("src/commonTest/kotlin/") + + val jsonSuiteGitCheckout = JsonSuiteGitCheckout(jsonTestSuiteSHA, destinationDir) + val schemaSuiteGitCheckout = SchemaSuiteGitCheckout(schemaTestSuiteSHA, destinationDir) + + jsonTestSuiteGenerator = JsonTestSuiteGenerator( + jsonSuiteGitCheckout, + schemaSuiteGitCheckout, + projectRoot, + sourceRoot, "org.kson.parser.json.generated" ) - init { // ensure we're out of date when/if the repo of test source files is deleted outputs.upToDateWhen { - jsonTestSuiteGenerator.testSuiteRootDir.toFile().exists() + jsonSuiteGitCheckout.checkoutDir.exists() + && schemaSuiteGitCheckout.checkoutDir.exists() } } - /** - * Register [JsonTestSuiteGenerator.jsonTestSuiteSHA] as an input to this script so that it is marked - * "out of date" whenever the script changes and re-runs - */ - @Input - fun getTestSuiteSHA(): String { - return jsonTestSuiteGenerator.jsonTestSuiteSHA - } - @OutputFiles fun getGeneratedTestPath(): List { - return listOf(jsonTestSuiteGenerator.generatedTestPath.toFile()) + return listOf(jsonTestSuiteGenerator.generatedJsonSuiteTestPath.toFile(), + jsonTestSuiteGenerator.generatedSchemaSuiteTestPath.toFile()) } @TaskAction @@ -53,6 +60,7 @@ open class GenerateJsonTestSuiteTask : DefaultTask() { @Internal override fun getDescription(): String? { - return "Generates src/commonTest/kotlin/org/kson/parser/json/generated/JsonSuiteTest.kt" + return "Generates ${jsonTestSuiteGenerator.generatedJsonSuiteTestPath} and " + + "${jsonTestSuiteGenerator.generatedSchemaSuiteTestPath}" } } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/kson/CleanGitCheckout.kt b/buildSrc/src/main/kotlin/org/kson/CleanGitCheckout.kt new file mode 100644 index 00000000..cee89c0f --- /dev/null +++ b/buildSrc/src/main/kotlin/org/kson/CleanGitCheckout.kt @@ -0,0 +1,76 @@ +package org.kson + +import org.eclipse.jgit.api.Git +import java.io.File +import java.nio.file.Path + +class NoRepoException(msg: String) : RuntimeException(msg) +class DirtyRepoException(msg: String) : RuntimeException(msg) + +/** + * Ensures there is a clean git checkout of [repoUri] in [cloneParentDir] at SHA [checkoutSHA] + * Note: will clone if does not exist, will error if not clean + * + * @param repoUri the URI of the repo to clone. May be any git URI that [org.eclipse.jgit.transport.URIish.URIish(java.lang.String)] + * can parse, including `https://` URIs and local file paths + * @param checkoutSHA the SHA of the desired clean checkout of the repo found at [repoUri] + * @param cloneParentDir the directory to place our cloned [repoUri] into + * @param cloneName the name of the directory in [cloneParentDir] to clone [repoUri] into + */ +open class CleanGitCheckout(private val repoUri: String, + private val checkoutSHA: String, + private val cloneParentDir: Path, + cloneName: String) { + val checkoutDir: File = File(cloneParentDir.toFile(), cloneName) + init { + ensureCleanGitCheckout() + } + + private fun ensureCleanGitCheckout() { + if (!checkoutDir.exists()) { + checkoutDir.mkdirs() + cloneRepository(repoUri, checkoutDir) + } else if (!File(checkoutDir, ".git").exists()) { + throw NoRepoException( + "ERROR: $checkoutDir should contain a checkout of https://github.com/nst/JSONTestSuite," + + "but it does not appear to be a git repo") + } + + val git = Git.init().setDirectory(checkoutDir).call() + if(!git.status().call().isClean) { + // throw if we're not clean... don't want to build because the source files might be incorrect, + // but also don't want to immediately blow it away since someone may have made changes on purpose + // for reasons we're not guessing, and quietly nuking those changes as a side-effect of the build + // could do them a real disservice + throw DirtyRepoException( + "ERROR: Dirty git status in $cloneParentDir. Please ensure the git status is clean " + + "or delete the directory and re-run this script") + } + + checkoutCommit(checkoutDir, checkoutSHA) + } + + /** + * Clone the given [uri] into [dir] + * + * @param uri will be passed to [org.eclipse.jgit.api.CloneCommand.setURI] to be parsed as a [org.eclipse.jgit.transport.URIish]) + * @param dir the directory to clone the repo at [uri] into + */ + private fun cloneRepository(uri: String, dir: File) { + Git.cloneRepository() + .setURI(uri) + .setDirectory(dir) + .call() + } + + /** + * Checks out the given [commit] of the repo found in [dir] + * + * @param dir a directory containing a git repo + * @param commit the commit of the repo in [dir] to be checked out + */ + private fun checkoutCommit(dir: File, commit: String) { + val git = Git.open(dir) + git.checkout().setName(commit).call() + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/kson/jsonsuite/JsonTestSuiteGenerator.kt b/buildSrc/src/main/kotlin/org/kson/jsonsuite/JsonTestSuiteGenerator.kt index f6092b96..a676302f 100644 --- a/buildSrc/src/main/kotlin/org/kson/jsonsuite/JsonTestSuiteGenerator.kt +++ b/buildSrc/src/main/kotlin/org/kson/jsonsuite/JsonTestSuiteGenerator.kt @@ -1,55 +1,53 @@ package org.kson.jsonsuite -import org.eclipse.jgit.api.Git -import java.io.File +import kotlinx.serialization.Serializable +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonElement import java.nio.file.Path /** - * [JsonTestSuiteGenerator] generates a class file of tests based on the tests defined in the [JSONTestSuite](https://github.com/nst/JSONTestSuite) - * project. By generating the tests into pure Kotlin test methods, we not only have the ergonomics of having - * an actual test method per JSON Suite test, we also get the benefit of being able to run them across all platforms - * without wrangling cross-platform file reads + * [JsonTestSuiteGenerator] generates native Kotlin tests based on the tests defined in + * [JSONTestSuite](https://github.com/nst/JSONTestSuite) and [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) + * + * By generating the tests into pure Kotlin test methods, we not only have the ergonomics of having + * an actual test method per test from these suites, we also get the benefit of being able to run them across all + * platforms without wrangling cross-platform file reads * * See [JsonTestSuiteEditList] for info on the adjustments we make to the JSONTestSuite to suit Kson's needs as a * superset of JSON * - * @param jsonTestSuiteSHA The SHA version of the tests to generate from - * @param projectRoot The absolute path on disk to the root of the project to generate JSONTestSuite tests into - * @param sourceRoot The source root of the project to place the generated test in, relative to [projectRoot] - * @param classPackage The package ("org.kson.parser.json") for instance. NOTES: the caller is responsible for setting - * this correctly + * @param jsonSuiteGitCheckout an instance of [JsonSuiteGitCheckout] + * @param schemaSuiteGitCheckout an instance of [SchemaSuiteGitCheckout] + * @param sourceRootDir The directory to consider the src root - [classPackage] will be used to determine which + * sub-folder relative to [sourceRootDir] to place generated tests into + * @param classPackage The package to place the generated tests into */ class JsonTestSuiteGenerator( - val jsonTestSuiteSHA: String, + private val jsonSuiteGitCheckout: JsonSuiteGitCheckout, + private val schemaSuiteGitCheckout: SchemaSuiteGitCheckout, private val projectRoot: Path, - private val sourceRoot: Path, + private val sourceRootDir: Path, private val classPackage: String ) { - private val buildSrcPath: Path = projectRoot.resolve("buildSrc") - - val testSuiteRootDir: Path = buildSrcPath.resolve("support/jsonsuite/JSONTestSuite") - val testDefinitionFilesDir: Path = testSuiteRootDir.resolve("test_parsing") - private val jsonTestSuiteRepoUrl = "https://github.com/nst/JSONTestSuite.git" - - val generatedTestPath: Path = - projectRoot.resolve(sourceRoot).resolve(classPackage.replace('.', '/')).resolve("JsonSuiteTest.kt") + val jsonTestSourceFilesDir: Path = jsonSuiteGitCheckout.checkoutDir.toPath().resolve("test_parsing") + private val testClassPackageDir = sourceRootDir.resolve(classPackage.replace('.', '/')) + val generatedJsonSuiteTestPath: Path = + testClassPackageDir.resolve("JsonSuiteTest.kt") + val generatedSchemaSuiteTestPath: Path = + testClassPackageDir.resolve("SchemaSuiteTest.kt") fun generate() { - // sanity check that we're actually running at the project root - if (!buildSrcPath.toFile().exists()) { - throw RuntimeException( - "Kson project buildSrc/ directory not found. " + - "Is parameter `projectRoot` correct? Current value: $projectRoot" - ) - } + testClassPackageDir.toFile().mkdirs() + + val jsonTestDataList = JsonTestDataLoader(jsonTestSourceFilesDir, projectRoot).loadTestData() + generatedJsonSuiteTestPath.toFile() + .writeText(generateJsonSuiteTestClass(this.javaClass.name, classPackage, jsonTestDataList)) - ensureCleanGitCheckout(jsonTestSuiteRepoUrl, jsonTestSuiteSHA, testSuiteRootDir) + val schemaTestSourceFilesDir: Path = schemaSuiteGitCheckout.checkoutDir.toPath().resolve("tests") + val schemaTestDataList = SchemaTestDataLoader(schemaTestSourceFilesDir, projectRoot).loadTestData() - //ensure that [testDefinitionFilesDir] contains the desired test source files - generatedTestPath.parent.toFile().mkdirs() - val testDataList = JsonTestDataLoader(testDefinitionFilesDir, projectRoot).loadTestData() - generatedTestPath.toFile() - .writeText(generateJsonSuiteTestClass(this.javaClass.name, classPackage, testDataList)) + generatedSchemaSuiteTestPath.toFile() + .writeText(generateSchemaSuiteTestClasses(this.javaClass.name, classPackage, schemaTestDataList)) } } @@ -99,6 +97,28 @@ private class JsonTestData( } } +/** + * The [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) tests are organized + * into groups where [schema] provides a Json Schema, and the list of [SchemaTestSpec] specify Json data + * to apply that schema to and whether that data should be considered valid or not + */ +@Serializable +private data class SchemaTestGroup(val description: String, + val comment: String? = null, + val schema: JsonElement, + val tests: List) +@Serializable +private data class SchemaTestSpec(val description: String, val data: JsonElement, val valid: Boolean) + +/** + * The test data we parse out of the test files provided by [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) + */ +private class SchemaTestData( + val testFileName: String, + val filePathFromProjectRoot: String, + val schemaTestGroups: List +) + private fun generateJsonSuiteTestClass( generatorClassName: String, testClassPackage: String, @@ -202,11 +222,92 @@ private fun assertParseResult( """ } +private fun generateSchemaSuiteTestClasses( + generatorClassName: String, + testClassPackage: String, + tests: List +): String { + return """package $testClassPackage + +import org.kson.Kson +import kotlin.test.Test +import kotlin.test.assertEquals + +/** + * DO NOT MANUALLY EDIT. This class is GENERATED by `./gradlew generateJsonTestSuite` task + * which calls [$generatorClassName]---see that class for more info. + * + * TODO expand the testing here as we implement Json Schema support by + * removing exclusions from [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ +class SchemaSuiteTest { + +${ tests.joinToString("\n") { + val theTests = ArrayList() + for (schema in it.schemaTestGroups) { + val schemaComment = if (schema.comment != null) "// " + schema.comment + "\n" else "" + for (test in schema.tests) { + // construct a legal and unique name for this test + val schemaTestName = "${formatForTestName(it.testFileName)}_${formatForTestName(schema.description)}_${formatForTestName(test.description)}" + val testCode = """ + | /** + | * Test generated by [$generatorClassName] based on `${it.filePathFromProjectRoot}`: + | * "${schema.description} -> ${test.description}" + | */ + | @Test + | fun $schemaTestName() {${ + if (schemaTestSuiteExclusions().contains(schemaTestName)) { + """ + | + | /** + | * TODO implement the schema functionality under test here and remove this exclusion from + | * "$schemaTestName" from + | * [org.kson.jsonsuite.schemaTestSuiteExclusions] + | */ + | return""".trimMargin() + } + else { + "" + }} + | assertKsonEnforcesSchema( + | ${"\"\"\""} + | ${formatForTest(test.data)} + | ${"\"\"\""}, + | ${"\"\"\""} + | ${schemaComment}${formatForTest(schema.schema)} + | ${"\"\"\""}, + | ${test.valid}, + | ${"\"\"\""}${formatForTest(schema.description)} -> ${formatForTest(test.description)}${"\"\"\""}) + | } + """.trimMargin() + theTests.add(testCode) + } + } + theTests.joinToString("\n\n") + }} + + private fun assertKsonEnforcesSchema(ksonSource: String, + schemaJson: String, + shouldAcceptAsValid: Boolean, + description: String) { + // accepted as valid if and only if we parsed without error + val acceptedAsValid = !Kson.parse(ksonSource.trimIndent(), schemaJson.trimIndent()) + .hasErrors() + + assertEquals( + shouldAcceptAsValid, + acceptedAsValid, + description) + } +} +""" +} + /** * This class manages loading and transforming the [JSONTestSuite](https://github.com/nst/JSONTestSuite) * tests to facilitate writing them as native, platform-independent, Kotlin tests in [JsonTestSuiteGenerator] * - * Property [jsonTestSuiteEditList] contains the list of tests we currently skip (todo: remove or document all skips) + * Property [jsonTestSuiteEditList] contains the list of tests we currently skip * * @param testDefinitionFilesDir the [Path] on disk to the [JSONTestSuite](https://github.com/nst/JSONTestSuite) test files * @param projectRoot the [Path] on disk of the project containing [testDefinitionFilesDir] - used to write out @@ -214,7 +315,7 @@ private fun assertParseResult( */ private class JsonTestDataLoader(private val testDefinitionFilesDir: Path, private val projectRoot: Path) { private val testFiles = (testDefinitionFilesDir.toFile().listFiles() - ?: throw RuntimeException("Should be able to list the files since runCommandLineSetup succeeded")) + ?: throw RuntimeException("Should have ensured these files existed before calling this loader")) init { val testDefinitionFileNames = testFiles.map { it.name }.toSet() @@ -242,58 +343,56 @@ private class JsonTestDataLoader(private val testDefinitionFilesDir: Path, priva } } -class NoRepoException(msg: String) : RuntimeException(msg) -class DirtyRepoException(msg: String) : RuntimeException(msg) - /** - * Ensures there is a checkout of [repoUrl] in [destinationDir] at SHA [checkoutSHA] - * Note: will clone if does not exist, will error if not clean + * This class manages loading and transforming the [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) + * tests to facilitate writing them as native, platform-independent, Kotlin tests in [JsonTestSuiteGenerator] + * + * NOTE: we currently only support Draft7 version of Json Schema. TODO expand support to other version. + * + * @param testDefinitionFilesDir the [Path] on disk to the [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) + * test files + * + * @param projectRoot the [Path] on disk of the project containing [testDefinitionFilesDir] - used to write out + * machine-independent file paths relative to the project root */ -fun ensureCleanGitCheckout(repoUrl: String, checkoutSHA: String, destinationDir: Path) { - val checkoutDir = destinationDir.toFile() - - if (!checkoutDir.exists()) { - cloneRepository(repoUrl, checkoutDir) - } else if (!File(checkoutDir, ".git").exists()) { - throw NoRepoException( - "ERROR: $checkoutDir should contain a checkout of https://github.com/nst/JSONTestSuite," + - "but it does not appear to be a git repo") +private class SchemaTestDataLoader(private val testDefinitionFilesDir: Path, private val projectRoot: Path) { + private val draftSevenTestSourceFiles = (testDefinitionFilesDir.resolve("draft7").toFile().listFiles() + ?: throw RuntimeException("Should have ensured these files existed before calling this loader")) + + fun loadTestData(): List { + return draftSevenTestSourceFiles + .filter { !it.isDirectory } + .map { + val contents = it.readText(Charsets.UTF_8) + val schemaTestGroups: List = prettyPrintingJson.decodeFromString(contents) + SchemaTestData( + it.nameWithoutExtension, + it.absolutePath.replace("$projectRoot/", ""), + schemaTestGroups, + ) + }.sortedBy { it.filePathFromProjectRoot } } +} - val git = Git.init().setDirectory(checkoutDir).call() - if(!git.status().call().isClean) { - // throw if we're not clean... don't want to build because the source files might be incorrect, - // but also don't want to immediately blow it away since someone may have made changes on purpose - // for reasons we're not guessing, and quietly nuking those changes as a side-effect of the build - // could do them a real disservice - throw DirtyRepoException( - "ERROR: Dirty git status in $destinationDir. Please ensure the git status is clean " + - "or delete the directory and re-run this script") - } +private val prettyPrintingJson = Json { prettyPrint = true } - checkoutCommit(checkoutDir, checkoutSHA) +private fun formatForTest(jsonElement: JsonElement): String { + return formatForTest(jsonElement.toString()) } -/** - * Clone the given [uri] into [dir] - * - * @param uri will be passed to [org.eclipse.jgit.api.CloneCommand.setURI] to be parsed as a [org.eclipse.jgit.transport.URIish]) - * @param dir the directory to clone the repo at [uri] into - */ -private fun cloneRepository(uri: String, dir: File) { - Git.cloneRepository() - .setURI(uri) - .setDirectory(dir) - .call() +private fun formatForTest(string: String): String { + return string.replace("$", "\${'$'}") } -/** - * Checks out the given [commit] of the repo found in [dir] - * - * @param dir a directory containing a git repo - * @param commit the commit of the repo in [dir] to be checked out - */ -private fun checkoutCommit(dir: File, commit: String) { - val git = Git.open(dir) - git.checkout().setName(commit).call() +private fun formatForTestName(string: String): String { + return formatForTest(string) + .replace(Regex("[.,()+\\-:'\\[\\]{}\"$/*=]"), "_") + .split(" ") + .mapIndexed { index, s -> + if (index > 0) { + s.replaceFirstChar { it.uppercase() } + } else { + s.replaceFirstChar { it.lowercase() } + } + }.joinToString("") } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/kson/jsonsuite/SchemaTestSuiteExclusionsList.kt b/buildSrc/src/main/kotlin/org/kson/jsonsuite/SchemaTestSuiteExclusionsList.kt new file mode 100644 index 00000000..d5f3bf52 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/kson/jsonsuite/SchemaTestSuiteExclusionsList.kt @@ -0,0 +1,909 @@ +package org.kson.jsonsuite + +/** + * This is the list of [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) + * tests which test as-yet unimplemented aspects of our Json Schema support. + * + * TODO: once Json Schema support is fully implemented, this list should be empty and hence deleted. + * This will likely be done in an iterative fashion, eliminating the exclusions here for few tests at a time + * as support is filled out + */ +fun schemaTestSuiteExclusions() = setOf( + "additionalItems_additionalItemsAreAllowedByDefault_onlyTheFirstItemIsValidated", + "additionalItems_additionalItemsAsFalseWithoutItems_ignoresNon_arrays", + "additionalItems_additionalItemsAsFalseWithoutItems_itemsDefaultsToEmptySchemaSoEverythingIsValid", + "additionalItems_additionalItemsAsSchema_additionalItemsDoNotMatchSchema", + "additionalItems_additionalItemsAsSchema_additionalItemsMatchSchema", + "additionalItems_additionalItemsDoesNotLookInApplicators_InvalidCase_itemsDefinedInAllOfAreNotExamined", + "additionalItems_additionalItemsDoesNotLookInApplicators_ValidCase_itemsDefinedInAllOfAreNotExamined", + "additionalItems_additionalItemsWithHeterogeneousArray_heterogeneousInvalidInstance", + "additionalItems_additionalItemsWithHeterogeneousArray_validInstance", + "additionalItems_additionalItemsWithNullInstanceElements_allowsNullElements", + "additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_additionalItemsAreNotPermitted", + "additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_emptyArray", + "additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_equalNumberOfItemsPresent", + "additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_fewerNumberOfItemsPresent_1_", + "additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_fewerNumberOfItemsPresent_2_", + "additionalItems_itemsValidationAdjustsTheStartingIndexForAdditionalItems_validItems", + "additionalItems_itemsValidationAdjustsTheStartingIndexForAdditionalItems_wrongTypeOfSecondItem", + "additionalItems_whenItemsIsSchema_AdditionalItemsDoesNothing_invalidWithAArrayOfMixedTypes", + "additionalItems_whenItemsIsSchema_AdditionalItemsDoesNothing_validWithAArrayOfTypeIntegers", + "additionalItems_whenItemsIsSchema_BooleanAdditionalItemsDoesNothing_allItemsMatchSchema", + "additionalProperties_additionalPropertiesAreAllowedByDefault_additionalPropertiesAreAllowed", + "additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_anAdditionalPropertyIsInvalid", + "additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_ignoresArrays", + "additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_ignoresOtherNon_objects", + "additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_ignoresStrings", + "additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_noAdditionalPropertiesIsValid", + "additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_patternPropertiesAreNotAdditionalProperties", + "additionalProperties_additionalPropertiesCanExistByItself_anAdditionalInvalidPropertyIsInvalid", + "additionalProperties_additionalPropertiesCanExistByItself_anAdditionalValidPropertyIsValid", + "additionalProperties_additionalPropertiesDoesNotLookInApplicators_propertiesDefinedInAllOfAreNotExamined", + "additionalProperties_additionalPropertiesWithNullValuedInstanceProperties_allowsNullValues", + "additionalProperties_additionalPropertiesWithSchema_anAdditionalInvalidPropertyIsInvalid", + "additionalProperties_additionalPropertiesWithSchema_anAdditionalValidPropertyIsValid", + "additionalProperties_additionalPropertiesWithSchema_noAdditionalPropertiesIsValid", + "additionalProperties_non_ASCIIPatternWithAdditionalProperties_matchingThePatternIsValid", + "additionalProperties_non_ASCIIPatternWithAdditionalProperties_notMatchingThePatternIsInvalid", + "allOf_allOfCombinedWithAnyOf_OneOf_allOf_False_AnyOf_False_OneOf_False", + "allOf_allOfCombinedWithAnyOf_OneOf_allOf_False_AnyOf_False_OneOf_True", + "allOf_allOfCombinedWithAnyOf_OneOf_allOf_False_AnyOf_True_OneOf_False", + "allOf_allOfCombinedWithAnyOf_OneOf_allOf_False_AnyOf_True_OneOf_True", + "allOf_allOfCombinedWithAnyOf_OneOf_allOf_True_AnyOf_False_OneOf_False", + "allOf_allOfCombinedWithAnyOf_OneOf_allOf_True_AnyOf_False_OneOf_True", + "allOf_allOfCombinedWithAnyOf_OneOf_allOf_True_AnyOf_True_OneOf_False", + "allOf_allOfCombinedWithAnyOf_OneOf_allOf_True_AnyOf_True_OneOf_True", + "allOf_allOfSimpleTypes_mismatchOne", + "allOf_allOfSimpleTypes_valid", + "allOf_allOfWithBaseSchema_mismatchBaseSchema", + "allOf_allOfWithBaseSchema_mismatchBoth", + "allOf_allOfWithBaseSchema_mismatchFirstAllOf", + "allOf_allOfWithBaseSchema_mismatchSecondAllOf", + "allOf_allOfWithBaseSchema_valid", + "allOf_allOfWithBooleanSchemas_AllFalse_anyValueIsInvalid", + "allOf_allOfWithBooleanSchemas_AllTrue_anyValueIsValid", + "allOf_allOfWithBooleanSchemas_SomeFalse_anyValueIsInvalid", + "allOf_allOfWithOneEmptySchema_anyDataIsValid", + "allOf_allOfWithTheFirstEmptySchema_numberIsValid", + "allOf_allOfWithTheFirstEmptySchema_stringIsInvalid", + "allOf_allOfWithTheLastEmptySchema_numberIsValid", + "allOf_allOfWithTheLastEmptySchema_stringIsInvalid", + "allOf_allOfWithTwoEmptySchemas_anyDataIsValid", + "allOf_allOf_allOf", + "allOf_allOf_mismatchFirst", + "allOf_allOf_mismatchSecond", + "allOf_allOf_wrongType", + "allOf_nestedAllOf_ToCheckValidationSemantics_anythingNon_nullIsInvalid", + "allOf_nestedAllOf_ToCheckValidationSemantics_nullIsValid", + "anyOf_anyOfComplexTypes_bothAnyOfValid_complex_", + "anyOf_anyOfComplexTypes_firstAnyOfValid_complex_", + "anyOf_anyOfComplexTypes_neitherAnyOfValid_complex_", + "anyOf_anyOfComplexTypes_secondAnyOfValid_complex_", + "anyOf_anyOfWithBaseSchema_bothAnyOfInvalid", + "anyOf_anyOfWithBaseSchema_mismatchBaseSchema", + "anyOf_anyOfWithBaseSchema_oneAnyOfValid", + "anyOf_anyOfWithBooleanSchemas_AllFalse_anyValueIsInvalid", + "anyOf_anyOfWithBooleanSchemas_AllTrue_anyValueIsValid", + "anyOf_anyOfWithBooleanSchemas_SomeTrue_anyValueIsValid", + "anyOf_anyOfWithOneEmptySchema_numberIsValid", + "anyOf_anyOfWithOneEmptySchema_stringIsValid", + "anyOf_anyOf_bothAnyOfValid", + "anyOf_anyOf_firstAnyOfValid", + "anyOf_anyOf_neitherAnyOfValid", + "anyOf_anyOf_secondAnyOfValid", + "anyOf_nestedAnyOf_ToCheckValidationSemantics_anythingNon_nullIsInvalid", + "anyOf_nestedAnyOf_ToCheckValidationSemantics_nullIsValid", + "boolean_schema_booleanSchema_false__arrayIsInvalid", + "boolean_schema_booleanSchema_false__booleanFalseIsInvalid", + "boolean_schema_booleanSchema_false__booleanTrueIsInvalid", + "boolean_schema_booleanSchema_false__emptyArrayIsInvalid", + "boolean_schema_booleanSchema_false__emptyObjectIsInvalid", + "boolean_schema_booleanSchema_false__nullIsInvalid", + "boolean_schema_booleanSchema_false__numberIsInvalid", + "boolean_schema_booleanSchema_false__objectIsInvalid", + "boolean_schema_booleanSchema_false__stringIsInvalid", + "const_constValidation_anotherTypeIsInvalid", + "const_constValidation_anotherValueIsInvalid", + "const_constValidation_sameValueIsValid", + "const_constWith0DoesNotMatchOtherZero_likeTypes_emptyArrayIsInvalid", + "const_constWith0DoesNotMatchOtherZero_likeTypes_emptyObjectIsInvalid", + "const_constWith0DoesNotMatchOtherZero_likeTypes_emptyStringIsInvalid", + "const_constWith0DoesNotMatchOtherZero_likeTypes_falseIsInvalid", + "const_constWith0DoesNotMatchOtherZero_likeTypes_floatZeroIsValid", + "const_constWith0DoesNotMatchOtherZero_likeTypes_integerZeroIsValid", + "const_constWith1DoesNotMatchTrue_floatOneIsValid", + "const_constWith1DoesNotMatchTrue_integerOneIsValid", + "const_constWith1DoesNotMatchTrue_trueIsInvalid", + "const_constWithArray_anotherArrayItemIsInvalid", + "const_constWithArray_arrayWithAdditionalItemsIsInvalid", + "const_constWithArray_sameArrayIsValid", + "const_constWithFalseDoesNotMatch0_falseIsValid", + "const_constWithFalseDoesNotMatch0_floatZeroIsInvalid", + "const_constWithFalseDoesNotMatch0_integerZeroIsInvalid", + "const_constWithNull_notNullIsInvalid", + "const_constWithNull_nullIsValid", + "const_constWithObject_anotherObjectIsInvalid", + "const_constWithObject_anotherTypeIsInvalid", + "const_constWithObject_sameObjectIsValid", + "const_constWithObject_sameObjectWithDifferentPropertyOrderIsValid", + "const_constWithTrueDoesNotMatch1_floatOneIsInvalid", + "const_constWithTrueDoesNotMatch1_integerOneIsInvalid", + "const_constWithTrueDoesNotMatch1_trueIsValid", + "const_constWith_2_0MatchesIntegerAndFloatTypes_float2_0IsInvalid", + "const_constWith_2_0MatchesIntegerAndFloatTypes_float_2_00001IsInvalid", + "const_constWith_2_0MatchesIntegerAndFloatTypes_float_2_0IsValid", + "const_constWith_2_0MatchesIntegerAndFloatTypes_integer2IsInvalid", + "const_constWith_2_0MatchesIntegerAndFloatTypes_integer_2IsValid", + "const_constWith__a__False_DoesNotMatch__a__0____a__0_0_IsInvalid", + "const_constWith__a__False_DoesNotMatch__a__0____a__0_IsInvalid", + "const_constWith__a__False_DoesNotMatch__a__0____a__False_IsValid", + "const_constWith__a__True_DoesNotMatch__a__1____a__1_0_IsInvalid", + "const_constWith__a__True_DoesNotMatch__a__1____a__1_IsInvalid", + "const_constWith__a__True_DoesNotMatch__a__1____a__True_IsValid", + "const_constWith_false_DoesNotMatch_0___0_0_IsInvalid", + "const_constWith_false_DoesNotMatch_0___0_IsInvalid", + "const_constWith_false_DoesNotMatch_0___false_IsValid", + "const_constWith_true_DoesNotMatch_1___1_0_IsInvalid", + "const_constWith_true_DoesNotMatch_1___1_IsInvalid", + "const_constWith_true_DoesNotMatch_1___true_IsValid", + "const_floatAndIntegersAreEqualUpTo64_bitRepresentationLimits_floatIsValid", + "const_floatAndIntegersAreEqualUpTo64_bitRepresentationLimits_floatMinusOneIsInvalid", + "const_floatAndIntegersAreEqualUpTo64_bitRepresentationLimits_integerIsValid", + "const_floatAndIntegersAreEqualUpTo64_bitRepresentationLimits_integerMinusOneIsInvalid", + "const_nulCharactersInStrings_doNotMatchStringLackingNul", + "const_nulCharactersInStrings_matchStringWithNul", + "contains_containsKeywordValidation_arrayWithItemMatchingSchema_5_IsValid", + "contains_containsKeywordValidation_arrayWithItemMatchingSchema_6_IsValid", + "contains_containsKeywordValidation_arrayWithTwoItemsMatchingSchema_5_6_IsValid", + "contains_containsKeywordValidation_arrayWithoutItemsMatchingSchemaIsInvalid", + "contains_containsKeywordValidation_emptyArrayIsInvalid", + "contains_containsKeywordValidation_notArrayIsValid", + "contains_containsKeywordWithBooleanSchemaFalse_anyNon_emptyArrayIsInvalid", + "contains_containsKeywordWithBooleanSchemaFalse_emptyArrayIsInvalid", + "contains_containsKeywordWithBooleanSchemaFalse_non_arraysAreValid", + "contains_containsKeywordWithBooleanSchemaTrue_anyNon_emptyArrayIsValid", + "contains_containsKeywordWithBooleanSchemaTrue_emptyArrayIsInvalid", + "contains_containsKeywordWithConstKeyword_arrayWithItem5IsValid", + "contains_containsKeywordWithConstKeyword_arrayWithTwoItems5IsValid", + "contains_containsKeywordWithConstKeyword_arrayWithoutItem5IsInvalid", + "contains_containsWithFalseIfSubschema_anyNon_emptyArrayIsValid", + "contains_containsWithFalseIfSubschema_emptyArrayIsInvalid", + "contains_containsWithNullInstanceElements_allowsNullItems", + "contains_items_Contains_doesNotMatchItems_MatchesContains", + "contains_items_Contains_matchesBothItemsAndContains", + "contains_items_Contains_matchesItems_DoesNotMatchContains", + "contains_items_Contains_matchesNeitherItemsNorContains", + "default_invalidStringValueForDefault_stillValidWhenTheInvalidDefaultIsUsed", + "default_invalidStringValueForDefault_validWhenPropertyIsSpecified", + "default_invalidTypeForDefault_stillValidWhenTheInvalidDefaultIsUsed", + "default_invalidTypeForDefault_validWhenPropertyIsSpecified", + "default_theDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing_anExplicitPropertyValueIsCheckedAgainstMaximum_failing_", + "default_theDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing_anExplicitPropertyValueIsCheckedAgainstMaximum_passing_", + "default_theDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing_missingPropertiesAreNotFilledInWithTheDefault", + "definitions_validateDefinitionAgainstMetaschema_invalidDefinitionSchema", + "definitions_validateDefinitionAgainstMetaschema_validDefinitionSchema", + "dependencies_dependenciesWithBooleanSubschemas_emptyObjectIsValid", + "dependencies_dependenciesWithBooleanSubschemas_objectWithBothPropertiesIsInvalid", + "dependencies_dependenciesWithBooleanSubschemas_objectWithPropertyHavingSchemaFalseIsInvalid", + "dependencies_dependenciesWithBooleanSubschemas_objectWithPropertyHavingSchemaTrueIsValid", + "dependencies_dependenciesWithEmptyArray_emptyObject", + "dependencies_dependenciesWithEmptyArray_non_objectIsValid", + "dependencies_dependenciesWithEmptyArray_objectWithOneProperty", + "dependencies_dependenciesWithEscapedCharacters_invalidObject1", + "dependencies_dependenciesWithEscapedCharacters_invalidObject2", + "dependencies_dependenciesWithEscapedCharacters_invalidObject3", + "dependencies_dependenciesWithEscapedCharacters_invalidObject4", + "dependencies_dependenciesWithEscapedCharacters_validObject1", + "dependencies_dependenciesWithEscapedCharacters_validObject2", + "dependencies_dependenciesWithEscapedCharacters_validObject3", + "dependencies_dependencies_ignoresArrays", + "dependencies_dependencies_ignoresOtherNon_objects", + "dependencies_dependencies_ignoresStrings", + "dependencies_dependencies_missingDependency", + "dependencies_dependencies_neither", + "dependencies_dependencies_nondependant", + "dependencies_dependencies_withDependency", + "dependencies_dependentSubschemaIncompatibleWithRoot_matchesBoth", + "dependencies_dependentSubschemaIncompatibleWithRoot_matchesDependency", + "dependencies_dependentSubschemaIncompatibleWithRoot_matchesRoot", + "dependencies_dependentSubschemaIncompatibleWithRoot_noDependency", + "dependencies_multipleDependenciesSubschema_noDependency", + "dependencies_multipleDependenciesSubschema_valid", + "dependencies_multipleDependenciesSubschema_wrongType", + "dependencies_multipleDependenciesSubschema_wrongTypeBoth", + "dependencies_multipleDependenciesSubschema_wrongTypeOther", + "dependencies_multipleDependencies_missingBothDependencies", + "dependencies_multipleDependencies_missingDependency", + "dependencies_multipleDependencies_missingOtherDependency", + "dependencies_multipleDependencies_neither", + "dependencies_multipleDependencies_nondependants", + "dependencies_multipleDependencies_withDependencies", + "enum_enumWith0DoesNotMatchFalse_falseIsInvalid", + "enum_enumWith0DoesNotMatchFalse_floatZeroIsValid", + "enum_enumWith0DoesNotMatchFalse_integerZeroIsValid", + "enum_enumWith1DoesNotMatchTrue_floatOneIsValid", + "enum_enumWith1DoesNotMatchTrue_integerOneIsValid", + "enum_enumWith1DoesNotMatchTrue_trueIsInvalid", + "enum_enumWithEscapedCharacters_anotherStringIsInvalid", + "enum_enumWithEscapedCharacters_member1IsValid", + "enum_enumWithEscapedCharacters_member2IsValid", + "enum_enumWithFalseDoesNotMatch0_falseIsValid", + "enum_enumWithFalseDoesNotMatch0_floatZeroIsInvalid", + "enum_enumWithFalseDoesNotMatch0_integerZeroIsInvalid", + "enum_enumWithTrueDoesNotMatch1_floatOneIsInvalid", + "enum_enumWithTrueDoesNotMatch1_integerOneIsInvalid", + "enum_enumWithTrueDoesNotMatch1_trueIsValid", + "enum_enumWith_0_DoesNotMatch_false___0_0_IsValid", + "enum_enumWith_0_DoesNotMatch_false___0_IsValid", + "enum_enumWith_0_DoesNotMatch_false___false_IsInvalid", + "enum_enumWith_1_DoesNotMatch_true___1_0_IsValid", + "enum_enumWith_1_DoesNotMatch_true___1_IsValid", + "enum_enumWith_1_DoesNotMatch_true___true_IsInvalid", + "enum_enumWith_false_DoesNotMatch_0___0_0_IsInvalid", + "enum_enumWith_false_DoesNotMatch_0___0_IsInvalid", + "enum_enumWith_false_DoesNotMatch_0___false_IsValid", + "enum_enumWith_true_DoesNotMatch_1___1_0_IsInvalid", + "enum_enumWith_true_DoesNotMatch_1___1_IsInvalid", + "enum_enumWith_true_DoesNotMatch_1___true_IsValid", + "enum_enumsInProperties_bothPropertiesAreValid", + "enum_enumsInProperties_missingAllPropertiesIsInvalid", + "enum_enumsInProperties_missingOptionalPropertyIsValid", + "enum_enumsInProperties_missingRequiredPropertyIsInvalid", + "enum_enumsInProperties_wrongBarValue", + "enum_enumsInProperties_wrongFooValue", + "enum_heterogeneousEnumValidation_extraPropertiesInObjectIsInvalid", + "enum_heterogeneousEnumValidation_objectsAreDeepCompared", + "enum_heterogeneousEnumValidation_oneOfTheEnumIsValid", + "enum_heterogeneousEnumValidation_somethingElseIsInvalid", + "enum_heterogeneousEnumValidation_validObjectMatches", + "enum_heterogeneousEnum_with_nullValidation_nullIsValid", + "enum_heterogeneousEnum_with_nullValidation_numberIsValid", + "enum_heterogeneousEnum_with_nullValidation_somethingElseIsInvalid", + "enum_nulCharactersInStrings_doNotMatchStringLackingNul", + "enum_nulCharactersInStrings_matchStringWithNul", + "enum_simpleEnumValidation_oneOfTheEnumIsValid", + "enum_simpleEnumValidation_somethingElseIsInvalid", + "exclusiveMaximum_exclusiveMaximumValidation_aboveTheExclusiveMaximumIsInvalid", + "exclusiveMaximum_exclusiveMaximumValidation_belowTheExclusiveMaximumIsValid", + "exclusiveMaximum_exclusiveMaximumValidation_boundaryPointIsInvalid", + "exclusiveMaximum_exclusiveMaximumValidation_ignoresNon_numbers", + "exclusiveMinimum_exclusiveMinimumValidation_aboveTheExclusiveMinimumIsValid", + "exclusiveMinimum_exclusiveMinimumValidation_belowTheExclusiveMinimumIsInvalid", + "exclusiveMinimum_exclusiveMinimumValidation_boundaryPointIsInvalid", + "exclusiveMinimum_exclusiveMinimumValidation_ignoresNon_numbers", + "format_dateFormat_allStringFormatsIgnoreArrays", + "format_dateFormat_allStringFormatsIgnoreBooleans", + "format_dateFormat_allStringFormatsIgnoreFloats", + "format_dateFormat_allStringFormatsIgnoreIntegers", + "format_dateFormat_allStringFormatsIgnoreNulls", + "format_dateFormat_allStringFormatsIgnoreObjects", + "format_date_timeFormat_allStringFormatsIgnoreArrays", + "format_date_timeFormat_allStringFormatsIgnoreBooleans", + "format_date_timeFormat_allStringFormatsIgnoreFloats", + "format_date_timeFormat_allStringFormatsIgnoreIntegers", + "format_date_timeFormat_allStringFormatsIgnoreNulls", + "format_date_timeFormat_allStringFormatsIgnoreObjects", + "format_emailFormat_allStringFormatsIgnoreArrays", + "format_emailFormat_allStringFormatsIgnoreBooleans", + "format_emailFormat_allStringFormatsIgnoreFloats", + "format_emailFormat_allStringFormatsIgnoreIntegers", + "format_emailFormat_allStringFormatsIgnoreNulls", + "format_emailFormat_allStringFormatsIgnoreObjects", + "format_hostnameFormat_allStringFormatsIgnoreArrays", + "format_hostnameFormat_allStringFormatsIgnoreBooleans", + "format_hostnameFormat_allStringFormatsIgnoreFloats", + "format_hostnameFormat_allStringFormatsIgnoreIntegers", + "format_hostnameFormat_allStringFormatsIgnoreNulls", + "format_hostnameFormat_allStringFormatsIgnoreObjects", + "format_idn_emailFormat_allStringFormatsIgnoreArrays", + "format_idn_emailFormat_allStringFormatsIgnoreBooleans", + "format_idn_emailFormat_allStringFormatsIgnoreFloats", + "format_idn_emailFormat_allStringFormatsIgnoreIntegers", + "format_idn_emailFormat_allStringFormatsIgnoreNulls", + "format_idn_emailFormat_allStringFormatsIgnoreObjects", + "format_idn_hostnameFormat_allStringFormatsIgnoreArrays", + "format_idn_hostnameFormat_allStringFormatsIgnoreBooleans", + "format_idn_hostnameFormat_allStringFormatsIgnoreFloats", + "format_idn_hostnameFormat_allStringFormatsIgnoreIntegers", + "format_idn_hostnameFormat_allStringFormatsIgnoreNulls", + "format_idn_hostnameFormat_allStringFormatsIgnoreObjects", + "format_ipv4Format_allStringFormatsIgnoreArrays", + "format_ipv4Format_allStringFormatsIgnoreBooleans", + "format_ipv4Format_allStringFormatsIgnoreFloats", + "format_ipv4Format_allStringFormatsIgnoreIntegers", + "format_ipv4Format_allStringFormatsIgnoreNulls", + "format_ipv4Format_allStringFormatsIgnoreObjects", + "format_ipv6Format_allStringFormatsIgnoreArrays", + "format_ipv6Format_allStringFormatsIgnoreBooleans", + "format_ipv6Format_allStringFormatsIgnoreFloats", + "format_ipv6Format_allStringFormatsIgnoreIntegers", + "format_ipv6Format_allStringFormatsIgnoreNulls", + "format_ipv6Format_allStringFormatsIgnoreObjects", + "format_iriFormat_allStringFormatsIgnoreArrays", + "format_iriFormat_allStringFormatsIgnoreBooleans", + "format_iriFormat_allStringFormatsIgnoreFloats", + "format_iriFormat_allStringFormatsIgnoreIntegers", + "format_iriFormat_allStringFormatsIgnoreNulls", + "format_iriFormat_allStringFormatsIgnoreObjects", + "format_iri_referenceFormat_allStringFormatsIgnoreArrays", + "format_iri_referenceFormat_allStringFormatsIgnoreBooleans", + "format_iri_referenceFormat_allStringFormatsIgnoreFloats", + "format_iri_referenceFormat_allStringFormatsIgnoreIntegers", + "format_iri_referenceFormat_allStringFormatsIgnoreNulls", + "format_iri_referenceFormat_allStringFormatsIgnoreObjects", + "format_json_pointerFormat_allStringFormatsIgnoreArrays", + "format_json_pointerFormat_allStringFormatsIgnoreBooleans", + "format_json_pointerFormat_allStringFormatsIgnoreFloats", + "format_json_pointerFormat_allStringFormatsIgnoreIntegers", + "format_json_pointerFormat_allStringFormatsIgnoreNulls", + "format_json_pointerFormat_allStringFormatsIgnoreObjects", + "format_regexFormat_allStringFormatsIgnoreArrays", + "format_regexFormat_allStringFormatsIgnoreBooleans", + "format_regexFormat_allStringFormatsIgnoreFloats", + "format_regexFormat_allStringFormatsIgnoreIntegers", + "format_regexFormat_allStringFormatsIgnoreNulls", + "format_regexFormat_allStringFormatsIgnoreObjects", + "format_relative_json_pointerFormat_allStringFormatsIgnoreArrays", + "format_relative_json_pointerFormat_allStringFormatsIgnoreBooleans", + "format_relative_json_pointerFormat_allStringFormatsIgnoreFloats", + "format_relative_json_pointerFormat_allStringFormatsIgnoreIntegers", + "format_relative_json_pointerFormat_allStringFormatsIgnoreNulls", + "format_relative_json_pointerFormat_allStringFormatsIgnoreObjects", + "format_timeFormat_allStringFormatsIgnoreArrays", + "format_timeFormat_allStringFormatsIgnoreBooleans", + "format_timeFormat_allStringFormatsIgnoreFloats", + "format_timeFormat_allStringFormatsIgnoreIntegers", + "format_timeFormat_allStringFormatsIgnoreNulls", + "format_timeFormat_allStringFormatsIgnoreObjects", + "format_uriFormat_allStringFormatsIgnoreArrays", + "format_uriFormat_allStringFormatsIgnoreBooleans", + "format_uriFormat_allStringFormatsIgnoreFloats", + "format_uriFormat_allStringFormatsIgnoreIntegers", + "format_uriFormat_allStringFormatsIgnoreNulls", + "format_uriFormat_allStringFormatsIgnoreObjects", + "format_uri_referenceFormat_allStringFormatsIgnoreArrays", + "format_uri_referenceFormat_allStringFormatsIgnoreBooleans", + "format_uri_referenceFormat_allStringFormatsIgnoreFloats", + "format_uri_referenceFormat_allStringFormatsIgnoreIntegers", + "format_uri_referenceFormat_allStringFormatsIgnoreNulls", + "format_uri_referenceFormat_allStringFormatsIgnoreObjects", + "format_uri_templateFormat_allStringFormatsIgnoreArrays", + "format_uri_templateFormat_allStringFormatsIgnoreBooleans", + "format_uri_templateFormat_allStringFormatsIgnoreFloats", + "format_uri_templateFormat_allStringFormatsIgnoreIntegers", + "format_uri_templateFormat_allStringFormatsIgnoreNulls", + "format_uri_templateFormat_allStringFormatsIgnoreObjects", + "if_then_else_ifAndElseWithoutThen_invalidThroughElse", + "if_then_else_ifAndElseWithoutThen_validThroughElse", + "if_then_else_ifAndElseWithoutThen_validWhenIfTestPasses", + "if_then_else_ifAndThenWithoutElse_invalidThroughThen", + "if_then_else_ifAndThenWithoutElse_validThroughThen", + "if_then_else_ifAndThenWithoutElse_validWhenIfTestFails", + "if_then_else_ifAppearsAtTheEndWhenSerialized_keywordProcessingSequence__invalidRedirectsToElseAndFails", + "if_then_else_ifAppearsAtTheEndWhenSerialized_keywordProcessingSequence__noRedirectsToThenAndFails", + "if_then_else_ifAppearsAtTheEndWhenSerialized_keywordProcessingSequence__otherRedirectsToElseAndPasses", + "if_then_else_ifAppearsAtTheEndWhenSerialized_keywordProcessingSequence__yesRedirectsToThenAndPasses", + "if_then_else_ifWithBooleanSchemaFalse_booleanSchemaFalseInIfAlwaysChoosesTheElsePath_invalid_", + "if_then_else_ifWithBooleanSchemaFalse_booleanSchemaFalseInIfAlwaysChoosesTheElsePath_valid_", + "if_then_else_ifWithBooleanSchemaTrue_booleanSchemaTrueInIfAlwaysChoosesTheThenPath_invalid_", + "if_then_else_ifWithBooleanSchemaTrue_booleanSchemaTrueInIfAlwaysChoosesTheThenPath_valid_", + "if_then_else_ignoreElseWithoutIf_validWhenInvalidAgainstLoneElse", + "if_then_else_ignoreElseWithoutIf_validWhenValidAgainstLoneElse", + "if_then_else_ignoreIfWithoutThenOrElse_validWhenInvalidAgainstLoneIf", + "if_then_else_ignoreIfWithoutThenOrElse_validWhenValidAgainstLoneIf", + "if_then_else_ignoreThenWithoutIf_validWhenInvalidAgainstLoneThen", + "if_then_else_ignoreThenWithoutIf_validWhenValidAgainstLoneThen", + "if_then_else_non_interferenceAcrossCombinedSchemas_valid_ButWouldHaveBeenInvalidThroughElse", + "if_then_else_non_interferenceAcrossCombinedSchemas_valid_ButWouldHaveBeenInvalidThroughThen", + "if_then_else_validateAgainstCorrectBranch_ThenVsElse_invalidThroughElse", + "if_then_else_validateAgainstCorrectBranch_ThenVsElse_invalidThroughThen", + "if_then_else_validateAgainstCorrectBranch_ThenVsElse_validThroughElse", + "if_then_else_validateAgainstCorrectBranch_ThenVsElse_validThroughThen", + "infinite_loop_detection_evaluatingTheSameSchemaLocationAgainstTheSameDataLocationTwiceIsNotASignOfAnInfiniteLoop_failingCase", + "infinite_loop_detection_evaluatingTheSameSchemaLocationAgainstTheSameDataLocationTwiceIsNotASignOfAnInfiniteLoop_passingCase", + "items_aSchemaGivenForItems_ignoresNon_arrays", + "items_aSchemaGivenForItems_javaScriptPseudo_arrayIsValid", + "items_aSchemaGivenForItems_validItems", + "items_aSchemaGivenForItems_wrongTypeOfItems", + "items_anArrayOfSchemasForItems_arrayWithAdditionalItems", + "items_anArrayOfSchemasForItems_correctTypes", + "items_anArrayOfSchemasForItems_emptyArray", + "items_anArrayOfSchemasForItems_incompleteArrayOfItems", + "items_anArrayOfSchemasForItems_javaScriptPseudo_arrayIsValid", + "items_anArrayOfSchemasForItems_wrongTypes", + "items_array_formItemsWithNullInstanceElements_allowsNullElements", + "items_itemsAndSubitems_fewerItemsIsValid", + "items_itemsAndSubitems_tooManyItems", + "items_itemsAndSubitems_tooManySub_items", + "items_itemsAndSubitems_validItems", + "items_itemsAndSubitems_wrongItem", + "items_itemsAndSubitems_wrongSub_item", + "items_itemsWithBooleanSchema_false__anyNon_emptyArrayIsInvalid", + "items_itemsWithBooleanSchema_false__emptyArrayIsValid", + "items_itemsWithBooleanSchema_true__anyArrayIsValid", + "items_itemsWithBooleanSchema_true__emptyArrayIsValid", + "items_itemsWithBooleanSchemas_arrayWithOneItemIsValid", + "items_itemsWithBooleanSchemas_arrayWithTwoItemsIsInvalid", + "items_itemsWithBooleanSchemas_emptyArrayIsValid", + "items_nestedItems_nestedArrayWithInvalidType", + "items_nestedItems_notDeepEnough", + "items_nestedItems_validNestedArray", + "items_single_formItemsWithNullInstanceElements_allowsNullElements", + "maxItems_maxItemsValidationWithADecimal_shorterIsValid", + "maxItems_maxItemsValidationWithADecimal_tooLongIsInvalid", + "maxItems_maxItemsValidation_exactLengthIsValid", + "maxItems_maxItemsValidation_ignoresNon_arrays", + "maxItems_maxItemsValidation_shorterIsValid", + "maxItems_maxItemsValidation_tooLongIsInvalid", + "maxLength_maxLengthValidationWithADecimal_shorterIsValid", + "maxLength_maxLengthValidationWithADecimal_tooLongIsInvalid", + "maxLength_maxLengthValidation_exactLengthIsValid", + "maxLength_maxLengthValidation_ignoresNon_strings", + "maxLength_maxLengthValidation_shorterIsValid", + "maxLength_maxLengthValidation_tooLongIsInvalid", + "maxLength_maxLengthValidation_twoGraphemesIsLongEnough", + "maxProperties_maxPropertiesValidationWithADecimal_shorterIsValid", + "maxProperties_maxPropertiesValidationWithADecimal_tooLongIsInvalid", + "maxProperties_maxPropertiesValidation_exactLengthIsValid", + "maxProperties_maxPropertiesValidation_ignoresArrays", + "maxProperties_maxPropertiesValidation_ignoresOtherNon_objects", + "maxProperties_maxPropertiesValidation_ignoresStrings", + "maxProperties_maxPropertiesValidation_shorterIsValid", + "maxProperties_maxPropertiesValidation_tooLongIsInvalid", + "maxProperties_maxProperties_0MeansTheObjectIsEmpty_noPropertiesIsValid", + "maxProperties_maxProperties_0MeansTheObjectIsEmpty_onePropertyIsInvalid", + "maximum_maximumValidationWithUnsignedInteger_aboveTheMaximumIsInvalid", + "maximum_maximumValidationWithUnsignedInteger_belowTheMaximumIsInvalid", + "maximum_maximumValidationWithUnsignedInteger_boundaryPointFloatIsValid", + "maximum_maximumValidationWithUnsignedInteger_boundaryPointIntegerIsValid", + "maximum_maximumValidation_aboveTheMaximumIsInvalid", + "maximum_maximumValidation_belowTheMaximumIsValid", + "maximum_maximumValidation_boundaryPointIsValid", + "maximum_maximumValidation_ignoresNon_numbers", + "minItems_minItemsValidationWithADecimal_longerIsValid", + "minItems_minItemsValidationWithADecimal_tooShortIsInvalid", + "minItems_minItemsValidation_exactLengthIsValid", + "minItems_minItemsValidation_ignoresNon_arrays", + "minItems_minItemsValidation_longerIsValid", + "minItems_minItemsValidation_tooShortIsInvalid", + "minLength_minLengthValidationWithADecimal_longerIsValid", + "minLength_minLengthValidationWithADecimal_tooShortIsInvalid", + "minLength_minLengthValidation_exactLengthIsValid", + "minLength_minLengthValidation_ignoresNon_strings", + "minLength_minLengthValidation_longerIsValid", + "minLength_minLengthValidation_oneGraphemeIsNotLongEnough", + "minLength_minLengthValidation_tooShortIsInvalid", + "minProperties_minPropertiesValidationWithADecimal_longerIsValid", + "minProperties_minPropertiesValidationWithADecimal_tooShortIsInvalid", + "minProperties_minPropertiesValidation_exactLengthIsValid", + "minProperties_minPropertiesValidation_ignoresArrays", + "minProperties_minPropertiesValidation_ignoresOtherNon_objects", + "minProperties_minPropertiesValidation_ignoresStrings", + "minProperties_minPropertiesValidation_longerIsValid", + "minProperties_minPropertiesValidation_tooShortIsInvalid", + "minimum_minimumValidationWithSignedInteger_boundaryPointIsValid", + "minimum_minimumValidationWithSignedInteger_boundaryPointWithFloatIsValid", + "minimum_minimumValidationWithSignedInteger_floatBelowTheMinimumIsInvalid", + "minimum_minimumValidationWithSignedInteger_ignoresNon_numbers", + "minimum_minimumValidationWithSignedInteger_intBelowTheMinimumIsInvalid", + "minimum_minimumValidationWithSignedInteger_negativeAboveTheMinimumIsValid", + "minimum_minimumValidationWithSignedInteger_positiveAboveTheMinimumIsValid", + "minimum_minimumValidation_aboveTheMinimumIsValid", + "minimum_minimumValidation_belowTheMinimumIsInvalid", + "minimum_minimumValidation_boundaryPointIsValid", + "minimum_minimumValidation_ignoresNon_numbers", + "multipleOf_byInt_ignoresNon_numbers", + "multipleOf_byInt_intByInt", + "multipleOf_byInt_intByIntFail", + "multipleOf_byNumber_35IsNotMultipleOf1_5", + "multipleOf_byNumber_4_5IsMultipleOf1_5", + "multipleOf_byNumber_zeroIsMultipleOfAnything", + "multipleOf_bySmallNumber_0_00751IsNotMultipleOf0_0001", + "multipleOf_bySmallNumber_0_0075IsMultipleOf0_0001", + "multipleOf_floatDivision_Inf_alwaysInvalid_ButNaiveImplementationsMayRaiseAnOverflowError", + "multipleOf_smallMultipleOfLargeInteger_anyIntegerIsAMultipleOf1e_8", + "not_allowEverythingWithBooleanSchemaFalse_arrayIsValid", + "not_allowEverythingWithBooleanSchemaFalse_booleanFalseIsValid", + "not_allowEverythingWithBooleanSchemaFalse_booleanTrueIsValid", + "not_allowEverythingWithBooleanSchemaFalse_emptyArrayIsValid", + "not_allowEverythingWithBooleanSchemaFalse_emptyObjectIsValid", + "not_allowEverythingWithBooleanSchemaFalse_nullIsValid", + "not_allowEverythingWithBooleanSchemaFalse_numberIsValid", + "not_allowEverythingWithBooleanSchemaFalse_objectIsValid", + "not_allowEverythingWithBooleanSchemaFalse_stringIsValid", + "not_doubleNegation_anyValueIsValid", + "not_forbidEverythingWithBooleanSchemaTrue_arrayIsInvalid", + "not_forbidEverythingWithBooleanSchemaTrue_booleanFalseIsInvalid", + "not_forbidEverythingWithBooleanSchemaTrue_booleanTrueIsInvalid", + "not_forbidEverythingWithBooleanSchemaTrue_emptyArrayIsInvalid", + "not_forbidEverythingWithBooleanSchemaTrue_emptyObjectIsInvalid", + "not_forbidEverythingWithBooleanSchemaTrue_nullIsInvalid", + "not_forbidEverythingWithBooleanSchemaTrue_numberIsInvalid", + "not_forbidEverythingWithBooleanSchemaTrue_objectIsInvalid", + "not_forbidEverythingWithBooleanSchemaTrue_stringIsInvalid", + "not_forbidEverythingWithEmptySchema_arrayIsInvalid", + "not_forbidEverythingWithEmptySchema_booleanFalseIsInvalid", + "not_forbidEverythingWithEmptySchema_booleanTrueIsInvalid", + "not_forbidEverythingWithEmptySchema_emptyArrayIsInvalid", + "not_forbidEverythingWithEmptySchema_emptyObjectIsInvalid", + "not_forbidEverythingWithEmptySchema_nullIsInvalid", + "not_forbidEverythingWithEmptySchema_numberIsInvalid", + "not_forbidEverythingWithEmptySchema_objectIsInvalid", + "not_forbidEverythingWithEmptySchema_stringIsInvalid", + "not_forbiddenProperty_propertyAbsent", + "not_forbiddenProperty_propertyPresent", + "not_notMoreComplexSchema_match", + "not_notMoreComplexSchema_mismatch", + "not_notMoreComplexSchema_otherMatch", + "not_notMultipleTypes_mismatch", + "not_notMultipleTypes_otherMismatch", + "not_notMultipleTypes_valid", + "not_not_allowed", + "not_not_disallowed", + "oneOf_nestedOneOf_ToCheckValidationSemantics_anythingNon_nullIsInvalid", + "oneOf_nestedOneOf_ToCheckValidationSemantics_nullIsValid", + "oneOf_oneOfComplexTypes_bothOneOfValid_complex_", + "oneOf_oneOfComplexTypes_firstOneOfValid_complex_", + "oneOf_oneOfComplexTypes_neitherOneOfValid_complex_", + "oneOf_oneOfComplexTypes_secondOneOfValid_complex_", + "oneOf_oneOfWithBaseSchema_bothOneOfValid", + "oneOf_oneOfWithBaseSchema_mismatchBaseSchema", + "oneOf_oneOfWithBaseSchema_oneOneOfValid", + "oneOf_oneOfWithBooleanSchemas_AllFalse_anyValueIsInvalid", + "oneOf_oneOfWithBooleanSchemas_AllTrue_anyValueIsInvalid", + "oneOf_oneOfWithBooleanSchemas_MoreThanOneTrue_anyValueIsInvalid", + "oneOf_oneOfWithBooleanSchemas_OneTrue_anyValueIsValid", + "oneOf_oneOfWithEmptySchema_bothValid_Invalid", + "oneOf_oneOfWithEmptySchema_oneValid_Valid", + "oneOf_oneOfWithMissingOptionalProperty_bothOneOfValid", + "oneOf_oneOfWithMissingOptionalProperty_firstOneOfValid", + "oneOf_oneOfWithMissingOptionalProperty_neitherOneOfValid", + "oneOf_oneOfWithMissingOptionalProperty_secondOneOfValid", + "oneOf_oneOfWithRequired_bothInvalid_Invalid", + "oneOf_oneOfWithRequired_bothValid_Invalid", + "oneOf_oneOfWithRequired_firstValid_Valid", + "oneOf_oneOfWithRequired_secondValid_Valid", + "oneOf_oneOf_bothOneOfValid", + "oneOf_oneOf_firstOneOfValid", + "oneOf_oneOf_neitherOneOfValid", + "oneOf_oneOf_secondOneOfValid", + "patternProperties_multipleSimultaneousPatternPropertiesAreValidated_aSimultaneousMatchIsValid", + "patternProperties_multipleSimultaneousPatternPropertiesAreValidated_aSingleValidMatchIsValid", + "patternProperties_multipleSimultaneousPatternPropertiesAreValidated_anInvalidDueToBothIsInvalid", + "patternProperties_multipleSimultaneousPatternPropertiesAreValidated_anInvalidDueToOneIsInvalid", + "patternProperties_multipleSimultaneousPatternPropertiesAreValidated_anInvalidDueToTheOtherIsInvalid", + "patternProperties_multipleSimultaneousPatternPropertiesAreValidated_multipleMatchesIsValid", + "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_aSingleInvalidMatchIsInvalid", + "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_aSingleValidMatchIsValid", + "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_ignoresArrays", + "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_ignoresOtherNon_objects", + "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_ignoresStrings", + "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_multipleInvalidMatchesIsInvalid", + "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_multipleValidMatchesIsValid", + "patternProperties_patternPropertiesWithBooleanSchemas_emptyObjectIsValid", + "patternProperties_patternPropertiesWithBooleanSchemas_objectWithAPropertyMatchingBothTrueAndFalseIsInvalid", + "patternProperties_patternPropertiesWithBooleanSchemas_objectWithBothPropertiesIsInvalid", + "patternProperties_patternPropertiesWithBooleanSchemas_objectWithPropertyMatchingSchemaFalseIsInvalid", + "patternProperties_patternPropertiesWithBooleanSchemas_objectWithPropertyMatchingSchemaTrueIsValid", + "patternProperties_patternPropertiesWithNullValuedInstanceProperties_allowsNullValues", + "patternProperties_regexesAreNotAnchoredByDefaultAndAreCaseSensitive_nonRecognizedMembersAreIgnored", + "patternProperties_regexesAreNotAnchoredByDefaultAndAreCaseSensitive_recognizedMembersAreAccountedFor", + "patternProperties_regexesAreNotAnchoredByDefaultAndAreCaseSensitive_regexesAreCaseSensitive", + "patternProperties_regexesAreNotAnchoredByDefaultAndAreCaseSensitive_regexesAreCaseSensitive_2", + "pattern_patternIsNotAnchored_matchesASubstring", + "pattern_patternValidation_aMatchingPatternIsValid", + "pattern_patternValidation_aNon_matchingPatternIsInvalid", + "pattern_patternValidation_ignoresArrays", + "pattern_patternValidation_ignoresBooleans", + "pattern_patternValidation_ignoresFloats", + "pattern_patternValidation_ignoresIntegers", + "pattern_patternValidation_ignoresNull", + "pattern_patternValidation_ignoresObjects", + "properties_objectPropertiesValidation_bothPropertiesInvalidIsInvalid", + "properties_objectPropertiesValidation_bothPropertiesPresentAndValidIsValid", + "properties_objectPropertiesValidation_doesn_tInvalidateOtherProperties", + "properties_objectPropertiesValidation_ignoresArrays", + "properties_objectPropertiesValidation_ignoresOtherNon_objects", + "properties_objectPropertiesValidation_onePropertyInvalidIsInvalid", + "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames___proto__NotValid", + "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_allPresentAndValid", + "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_constructorNotValid", + "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_ignoresArrays", + "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_ignoresOtherNon_objects", + "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_noneOfThePropertiesMentioned", + "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_toStringNotValid", + "properties_propertiesWithBooleanSchema_bothPropertiesPresentIsInvalid", + "properties_propertiesWithBooleanSchema_noPropertyPresentIsValid", + "properties_propertiesWithBooleanSchema_only_false_PropertyPresentIsInvalid", + "properties_propertiesWithBooleanSchema_only_true_PropertyPresentIsValid", + "properties_propertiesWithEscapedCharacters_objectWithAllNumbersIsValid", + "properties_propertiesWithEscapedCharacters_objectWithStringsIsInvalid", + "properties_propertiesWithNullValuedInstanceProperties_allowsNullValues", + "properties_properties_PatternProperties_AdditionalPropertiesInteraction_additionalPropertyIgnoresProperty", + "properties_properties_PatternProperties_AdditionalPropertiesInteraction_additionalPropertyInvalidatesOthers", + "properties_properties_PatternProperties_AdditionalPropertiesInteraction_additionalPropertyValidatesOthers", + "properties_properties_PatternProperties_AdditionalPropertiesInteraction_patternPropertyInvalidatesNonproperty", + "properties_properties_PatternProperties_AdditionalPropertiesInteraction_patternPropertyInvalidatesProperty", + "properties_properties_PatternProperties_AdditionalPropertiesInteraction_patternPropertyValidatesNonproperty", + "properties_properties_PatternProperties_AdditionalPropertiesInteraction_propertyInvalidatesProperty", + "properties_properties_PatternProperties_AdditionalPropertiesInteraction_propertyValidatesProperty", + "propertyNames_propertyNamesValidationWithPattern_matchingPropertyNamesValid", + "propertyNames_propertyNamesValidationWithPattern_non_matchingPropertyNameIsInvalid", + "propertyNames_propertyNamesValidationWithPattern_objectWithoutPropertiesIsValid", + "propertyNames_propertyNamesValidation_allPropertyNamesValid", + "propertyNames_propertyNamesValidation_ignoresArrays", + "propertyNames_propertyNamesValidation_ignoresOtherNon_objects", + "propertyNames_propertyNamesValidation_ignoresStrings", + "propertyNames_propertyNamesValidation_objectWithoutPropertiesIsValid", + "propertyNames_propertyNamesValidation_somePropertyNamesInvalid", + "propertyNames_propertyNamesWithBooleanSchemaFalse_emptyObjectIsValid", + "propertyNames_propertyNamesWithBooleanSchemaFalse_objectWithAnyPropertiesIsInvalid", + "propertyNames_propertyNamesWithBooleanSchemaTrue_emptyObjectIsValid", + "propertyNames_propertyNamesWithBooleanSchemaTrue_objectWithAnyPropertiesIsValid", + "refRemote_______refTo______refFindsLocation_independent______id_non_numberIsInvalid", + "refRemote_______refTo______refFindsLocation_independent______id_numberIsValid", + "refRemote_baseURIChange_ChangeFolderInSubschema_numberIsValid", + "refRemote_baseURIChange_ChangeFolderInSubschema_stringIsInvalid", + "refRemote_baseURIChange_ChangeFolder_numberIsValid", + "refRemote_baseURIChange_ChangeFolder_stringIsInvalid", + "refRemote_baseURIChange_baseURIChangeRefInvalid", + "refRemote_baseURIChange_baseURIChangeRefValid", + "refRemote_fragmentWithinRemoteRef_remoteFragmentInvalid", + "refRemote_fragmentWithinRemoteRef_remoteFragmentValid", + "refRemote_location_independentIdentifierInRemoteRef_integerIsValid", + "refRemote_location_independentIdentifierInRemoteRef_stringIsInvalid", + "refRemote_refWithinRemoteRef_refWithinRefInvalid", + "refRemote_refWithinRemoteRef_refWithinRefValid", + "refRemote_remoteRefWithRefToDefinitions_invalid", + "refRemote_remoteRefWithRefToDefinitions_valid", + "refRemote_remoteRef_remoteRefInvalid", + "refRemote_remoteRef_remoteRefValid", + "refRemote_retrievedNestedRefsResolveRelativeToTheirURINot______id_numberIsInvalid", + "refRemote_retrievedNestedRefsResolveRelativeToTheirURINot______id_stringIsValid", + "refRemote_rootRefInRemoteRef_nullIsValid", + "refRemote_rootRefInRemoteRef_objectIsInvalid", + "refRemote_rootRefInRemoteRef_stringIsValid", + "ref_______idMustBeResolvedAgainstNearestParent_NotJustImmediateParent_non_numberIsInvalid", + "ref_______idMustBeResolvedAgainstNearestParent_NotJustImmediateParent_numberIsValid", + "ref_______idWithFileURIStillResolvesPointers_Windows_non_numberIsInvalid", + "ref_______idWithFileURIStillResolvesPointers_Windows_numberIsValid", + "ref_______idWithFileURIStillResolvesPointers__nix_non_numberIsInvalid", + "ref_______idWithFileURIStillResolvesPointers__nix_numberIsValid", + "ref_______refPreventsASibling______idFromChangingTheBaseUri_______refResolvesTo_definitions_base_foo_DataDoesNotValidate", + "ref_______refPreventsASibling______idFromChangingTheBaseUri_______refResolvesTo_definitions_base_foo_DataValidates", + "ref_______refToBooleanSchemaFalse_anyValueIsInvalid", + "ref_______refToBooleanSchemaTrue_anyValueIsValid", + "ref_emptyTokensIn______refJson_pointer_non_numberIsInvalid", + "ref_emptyTokensIn______refJson_pointer_numberIsValid", + "ref_escapedPointerRef_percentInvalid", + "ref_escapedPointerRef_percentValid", + "ref_escapedPointerRef_slashInvalid", + "ref_escapedPointerRef_slashValid", + "ref_escapedPointerRef_tildeInvalid", + "ref_escapedPointerRef_tildeValid", + "ref_location_independentIdentifierWithBaseURIChangeInSubschema_match", + "ref_location_independentIdentifierWithBaseURIChangeInSubschema_mismatch", + "ref_location_independentIdentifier_match", + "ref_location_independentIdentifier_mismatch", + "ref_naiveReplacementOf______refWithItsDestinationIsNotCorrect_doNotEvaluateThe______refInsideTheEnum_DefinitionExactMatch", + "ref_naiveReplacementOf______refWithItsDestinationIsNotCorrect_doNotEvaluateThe______refInsideTheEnum_MatchingAnyString", + "ref_naiveReplacementOf______refWithItsDestinationIsNotCorrect_matchTheEnumExactly", + "ref_nestedRefs_nestedRefInvalid", + "ref_nestedRefs_nestedRefValid", + "ref_propertyNamed______refThatIsNotAReference_propertyNamed______refInvalid", + "ref_propertyNamed______refThatIsNotAReference_propertyNamed______refValid", + "ref_propertyNamed______ref_ContainingAnActual______ref_propertyNamed______refInvalid", + "ref_propertyNamed______ref_ContainingAnActual______ref_propertyNamed______refValid", + "ref_recursiveReferencesBetweenSchemas_invalidTree", + "ref_recursiveReferencesBetweenSchemas_validTree", + "ref_refOverridesAnySiblingKeywords_refInvalid", + "ref_refOverridesAnySiblingKeywords_refValid", + "ref_refOverridesAnySiblingKeywords_refValid_MaxItemsIgnored", + "ref_refToElse_aNon_integerIsInvalidDueToThe______ref", + "ref_refToElse_anIntegerIsValid", + "ref_refToIf_aNon_integerIsInvalidDueToThe______ref", + "ref_refToIf_anIntegerIsValid", + "ref_refToThen_aNon_integerIsInvalidDueToThe______ref", + "ref_refToThen_anIntegerIsValid", + "ref_refWithAbsolute_path_reference_aStringIsValid", + "ref_refWithAbsolute_path_reference_anIntegerIsInvalid", + "ref_referenceAnAnchorWithANon_relativeURI_match", + "ref_referenceAnAnchorWithANon_relativeURI_mismatch", + "ref_refsWithQuote_objectWithNumbersIsValid", + "ref_refsWithQuote_objectWithStringsIsInvalid", + "ref_refsWithRelativeUrisAndDefs_invalidOnInnerField", + "ref_refsWithRelativeUrisAndDefs_invalidOnOuterField", + "ref_refsWithRelativeUrisAndDefs_validOnBothFields", + "ref_relativePointerRefToArray_matchArray", + "ref_relativePointerRefToArray_mismatchArray", + "ref_relativePointerRefToObject_match", + "ref_relativePointerRefToObject_mismatch", + "ref_relativeRefsWithAbsoluteUrisAndDefs_invalidOnInnerField", + "ref_relativeRefsWithAbsoluteUrisAndDefs_invalidOnOuterField", + "ref_relativeRefsWithAbsoluteUrisAndDefs_validOnBothFields", + "ref_remoteRef_ContainingRefsItself_remoteRefInvalid", + "ref_remoteRef_ContainingRefsItself_remoteRefValid", + "ref_rootPointerRef_match", + "ref_rootPointerRef_mismatch", + "ref_rootPointerRef_recursiveMatch", + "ref_rootPointerRef_recursiveMismatch", + "ref_simpleURNBaseURIWithJSONPointer_aNon_stringIsInvalid", + "ref_simpleURNBaseURIWithJSONPointer_aStringIsValid", + "ref_simpleURNBaseURIWith______refViaTheURN_invalidUnderTheURNIDedSchema", + "ref_simpleURNBaseURIWith______refViaTheURN_validUnderTheURNIDedSchema", + "ref_uRNBaseURIWithNSS_aNon_stringIsInvalid", + "ref_uRNBaseURIWithNSS_aStringIsValid", + "ref_uRNBaseURIWithQ_component_aNon_stringIsInvalid", + "ref_uRNBaseURIWithQ_component_aStringIsValid", + "ref_uRNBaseURIWithR_component_aNon_stringIsInvalid", + "ref_uRNBaseURIWithR_component_aStringIsValid", + "ref_uRNBaseURIWithURNAndAnchorRef_aNon_stringIsInvalid", + "ref_uRNBaseURIWithURNAndAnchorRef_aStringIsValid", + "ref_uRNBaseURIWithURNAndJSONPointerRef_aNon_stringIsInvalid", + "ref_uRNBaseURIWithURNAndJSONPointerRef_aStringIsValid", + "required_requiredDefaultValidation_notRequiredByDefault", + "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames___proto__Present", + "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_allPresent", + "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_constructorPresent", + "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_ignoresArrays", + "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_ignoresOtherNon_objects", + "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_noneOfThePropertiesMentioned", + "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_toStringPresent", + "required_requiredValidation_ignoresArrays", + "required_requiredValidation_ignoresOtherNon_objects", + "required_requiredValidation_ignoresStrings", + "required_requiredValidation_non_presentRequiredPropertyIsInvalid", + "required_requiredValidation_presentRequiredPropertyIsValid", + "required_requiredWithEmptyArray_propertyNotRequired", + "required_requiredWithEscapedCharacters_objectWithAllPropertiesPresentIsValid", + "required_requiredWithEscapedCharacters_objectWithSomePropertiesMissingIsInvalid", + "type_arrayTypeMatchesArrays_aBooleanIsNotAnArray", + "type_arrayTypeMatchesArrays_aFloatIsNotAnArray", + "type_arrayTypeMatchesArrays_aStringIsNotAnArray", + "type_arrayTypeMatchesArrays_anArrayIsAnArray", + "type_arrayTypeMatchesArrays_anIntegerIsNotAnArray", + "type_arrayTypeMatchesArrays_anObjectIsNotAnArray", + "type_arrayTypeMatchesArrays_nullIsNotAnArray", + "type_booleanTypeMatchesBooleans_aFloatIsNotABoolean", + "type_booleanTypeMatchesBooleans_aStringIsNotABoolean", + "type_booleanTypeMatchesBooleans_anArrayIsNotABoolean", + "type_booleanTypeMatchesBooleans_anEmptyStringIsNotABoolean", + "type_booleanTypeMatchesBooleans_anIntegerIsNotABoolean", + "type_booleanTypeMatchesBooleans_anObjectIsNotABoolean", + "type_booleanTypeMatchesBooleans_falseIsABoolean", + "type_booleanTypeMatchesBooleans_nullIsNotABoolean", + "type_booleanTypeMatchesBooleans_trueIsABoolean", + "type_booleanTypeMatchesBooleans_zeroIsNotABoolean", + "type_integerTypeMatchesIntegers_aBooleanIsNotAnInteger", + "type_integerTypeMatchesIntegers_aFloatIsNotAnInteger", + "type_integerTypeMatchesIntegers_aFloatWithZeroFractionalPartIsAnInteger", + "type_integerTypeMatchesIntegers_aStringIsNotAnInteger", + "type_integerTypeMatchesIntegers_aStringIsStillNotAnInteger_EvenIfItLooksLikeOne", + "type_integerTypeMatchesIntegers_anArrayIsNotAnInteger", + "type_integerTypeMatchesIntegers_anIntegerIsAnInteger", + "type_integerTypeMatchesIntegers_anObjectIsNotAnInteger", + "type_integerTypeMatchesIntegers_nullIsNotAnInteger", + "type_multipleTypesCanBeSpecifiedInAnArray_aBooleanIsInvalid", + "type_multipleTypesCanBeSpecifiedInAnArray_aFloatIsInvalid", + "type_multipleTypesCanBeSpecifiedInAnArray_aStringIsValid", + "type_multipleTypesCanBeSpecifiedInAnArray_anArrayIsInvalid", + "type_multipleTypesCanBeSpecifiedInAnArray_anIntegerIsValid", + "type_multipleTypesCanBeSpecifiedInAnArray_anObjectIsInvalid", + "type_multipleTypesCanBeSpecifiedInAnArray_nullIsInvalid", + "type_nullTypeMatchesOnlyTheNullObject_aFloatIsNotNull", + "type_nullTypeMatchesOnlyTheNullObject_aStringIsNotNull", + "type_nullTypeMatchesOnlyTheNullObject_anArrayIsNotNull", + "type_nullTypeMatchesOnlyTheNullObject_anEmptyStringIsNotNull", + "type_nullTypeMatchesOnlyTheNullObject_anIntegerIsNotNull", + "type_nullTypeMatchesOnlyTheNullObject_anObjectIsNotNull", + "type_nullTypeMatchesOnlyTheNullObject_falseIsNotNull", + "type_nullTypeMatchesOnlyTheNullObject_nullIsNull", + "type_nullTypeMatchesOnlyTheNullObject_trueIsNotNull", + "type_nullTypeMatchesOnlyTheNullObject_zeroIsNotNull", + "type_numberTypeMatchesNumbers_aBooleanIsNotANumber", + "type_numberTypeMatchesNumbers_aFloatIsANumber", + "type_numberTypeMatchesNumbers_aFloatWithZeroFractionalPartIsANumber_andAnInteger_", + "type_numberTypeMatchesNumbers_aStringIsNotANumber", + "type_numberTypeMatchesNumbers_aStringIsStillNotANumber_EvenIfItLooksLikeOne", + "type_numberTypeMatchesNumbers_anArrayIsNotANumber", + "type_numberTypeMatchesNumbers_anIntegerIsANumber", + "type_numberTypeMatchesNumbers_anObjectIsNotANumber", + "type_numberTypeMatchesNumbers_nullIsNotANumber", + "type_objectTypeMatchesObjects_aBooleanIsNotAnObject", + "type_objectTypeMatchesObjects_aFloatIsNotAnObject", + "type_objectTypeMatchesObjects_aStringIsNotAnObject", + "type_objectTypeMatchesObjects_anArrayIsNotAnObject", + "type_objectTypeMatchesObjects_anIntegerIsNotAnObject", + "type_objectTypeMatchesObjects_anObjectIsAnObject", + "type_objectTypeMatchesObjects_nullIsNotAnObject", + "type_stringTypeMatchesStrings_1IsNotAString", + "type_stringTypeMatchesStrings_aBooleanIsNotAString", + "type_stringTypeMatchesStrings_aFloatIsNotAString", + "type_stringTypeMatchesStrings_aStringIsAString", + "type_stringTypeMatchesStrings_aStringIsStillAString_EvenIfItLooksLikeANumber", + "type_stringTypeMatchesStrings_anArrayIsNotAString", + "type_stringTypeMatchesStrings_anEmptyStringIsStillAString", + "type_stringTypeMatchesStrings_anObjectIsNotAString", + "type_stringTypeMatchesStrings_nullIsNotAString", + "type_typeAsArrayWithOneItem_numberIsInvalid", + "type_typeAsArrayWithOneItem_stringIsValid", + "type_type_ArrayOrObject_arrayIsValid", + "type_type_ArrayOrObject_nullIsInvalid", + "type_type_ArrayOrObject_numberIsInvalid", + "type_type_ArrayOrObject_objectIsValid", + "type_type_ArrayOrObject_stringIsInvalid", + "type_type_Array_ObjectOrNull_arrayIsValid", + "type_type_Array_ObjectOrNull_nullIsValid", + "type_type_Array_ObjectOrNull_numberIsInvalid", + "type_type_Array_ObjectOrNull_objectIsValid", + "type_type_Array_ObjectOrNull_stringIsInvalid", + "uniqueItems_uniqueItemsValidation_0AndFalseAreUnique", + "uniqueItems_uniqueItemsValidation_1AndTrueAreUnique", + "uniqueItems_uniqueItemsValidation__0_And_false_AreUnique", + "uniqueItems_uniqueItemsValidation__1_And_true_AreUnique", + "uniqueItems_uniqueItemsValidation___a__False_And__a__0_AreUnique", + "uniqueItems_uniqueItemsValidation___a__True_And__a__1_AreUnique", + "uniqueItems_uniqueItemsValidation_differentObjectsAreUnique", + "uniqueItems_uniqueItemsValidation_falseIsNotEqualToZero", + "uniqueItems_uniqueItemsValidation_nested_0_And_false_AreUnique", + "uniqueItems_uniqueItemsValidation_nested_1_And_true_AreUnique", + "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfArraysIsInvalid", + "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfIntegersIsInvalid", + "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfMoreThanTwoArraysIsInvalid", + "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfMoreThanTwoIntegersIsInvalid", + "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfNestedObjectsIsInvalid", + "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfObjectsIsInvalid", + "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfStringsIsInvalid", + "uniqueItems_uniqueItemsValidation_non_uniqueHeterogeneousTypesAreInvalid", + "uniqueItems_uniqueItemsValidation_numbersAreUniqueIfMathematicallyUnequal", + "uniqueItems_uniqueItemsValidation_objectsAreNon_uniqueDespiteKeyOrder", + "uniqueItems_uniqueItemsValidation_propertyOrderOfArrayOfObjectsIsIgnored", + "uniqueItems_uniqueItemsValidation_trueIsNotEqualToOne", + "uniqueItems_uniqueItemsValidation_uniqueArrayOfArraysIsValid", + "uniqueItems_uniqueItemsValidation_uniqueArrayOfIntegersIsValid", + "uniqueItems_uniqueItemsValidation_uniqueArrayOfNestedObjectsIsValid", + "uniqueItems_uniqueItemsValidation_uniqueArrayOfObjectsIsValid", + "uniqueItems_uniqueItemsValidation_uniqueArrayOfStringsIsValid", + "uniqueItems_uniqueItemsValidation_uniqueHeterogeneousTypesAreValid", + "uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false__false_False_FromItemsArrayIsNotValid", + "uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false__false_True_FromItemsArrayIsValid", + "uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false__true_False_FromItemsArrayIsValid", + "uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false__true_True_FromItemsArrayIsNotValid", + "uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false_extraItemsAreInvalidEvenIfUnique", + "uniqueItems_uniqueItemsWithAnArrayOfItems__false_False_FromItemsArrayIsNotValid", + "uniqueItems_uniqueItemsWithAnArrayOfItems__false_True_FromItemsArrayIsValid", + "uniqueItems_uniqueItemsWithAnArrayOfItems__true_False_FromItemsArrayIsValid", + "uniqueItems_uniqueItemsWithAnArrayOfItems__true_True_FromItemsArrayIsNotValid", + "uniqueItems_uniqueItemsWithAnArrayOfItems_non_uniqueArrayExtendedFrom_false_True_IsNotValid", + "uniqueItems_uniqueItemsWithAnArrayOfItems_non_uniqueArrayExtendedFrom_true_False_IsNotValid", + "uniqueItems_uniqueItemsWithAnArrayOfItems_uniqueArrayExtendedFrom_false_True_IsValid", + "uniqueItems_uniqueItemsWithAnArrayOfItems_uniqueArrayExtendedFrom_true_False_IsValid", + "uniqueItems_uniqueItems_falseValidation_0AndFalseAreUnique", + "uniqueItems_uniqueItems_falseValidation_1AndTrueAreUnique", + "uniqueItems_uniqueItems_falseValidation_falseIsNotEqualToZero", + "uniqueItems_uniqueItems_falseValidation_non_uniqueArrayOfArraysIsValid", + "uniqueItems_uniqueItems_falseValidation_non_uniqueArrayOfIntegersIsValid", + "uniqueItems_uniqueItems_falseValidation_non_uniqueArrayOfNestedObjectsIsValid", + "uniqueItems_uniqueItems_falseValidation_non_uniqueArrayOfObjectsIsValid", + "uniqueItems_uniqueItems_falseValidation_non_uniqueHeterogeneousTypesAreValid", + "uniqueItems_uniqueItems_falseValidation_numbersAreUniqueIfMathematicallyUnequal", + "uniqueItems_uniqueItems_falseValidation_trueIsNotEqualToOne", + "uniqueItems_uniqueItems_falseValidation_uniqueArrayOfArraysIsValid", + "uniqueItems_uniqueItems_falseValidation_uniqueArrayOfIntegersIsValid", + "uniqueItems_uniqueItems_falseValidation_uniqueArrayOfNestedObjectsIsValid", + "uniqueItems_uniqueItems_falseValidation_uniqueArrayOfObjectsIsValid", + "uniqueItems_uniqueItems_falseValidation_uniqueHeterogeneousTypesAreValid", + "uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false__false_False_FromItemsArrayIsValid", + "uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false__false_True_FromItemsArrayIsValid", + "uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false__true_False_FromItemsArrayIsValid", + "uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false__true_True_FromItemsArrayIsValid", + "uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false_extraItemsAreInvalidEvenIfUnique", + "uniqueItems_uniqueItems_falseWithAnArrayOfItems__false_False_FromItemsArrayIsValid", + "uniqueItems_uniqueItems_falseWithAnArrayOfItems__false_True_FromItemsArrayIsValid", + "uniqueItems_uniqueItems_falseWithAnArrayOfItems__true_False_FromItemsArrayIsValid", + "uniqueItems_uniqueItems_falseWithAnArrayOfItems__true_True_FromItemsArrayIsValid", + "uniqueItems_uniqueItems_falseWithAnArrayOfItems_non_uniqueArrayExtendedFrom_false_True_IsValid", + "uniqueItems_uniqueItems_falseWithAnArrayOfItems_non_uniqueArrayExtendedFrom_true_False_IsValid", + "uniqueItems_uniqueItems_falseWithAnArrayOfItems_uniqueArrayExtendedFrom_false_True_IsValid", + "uniqueItems_uniqueItems_falseWithAnArrayOfItems_uniqueArrayExtendedFrom_true_False_IsValid" +) \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/kson/jsonsuite/TestSuiteGitCheckout.kt b/buildSrc/src/main/kotlin/org/kson/jsonsuite/TestSuiteGitCheckout.kt new file mode 100644 index 00000000..8011206a --- /dev/null +++ b/buildSrc/src/main/kotlin/org/kson/jsonsuite/TestSuiteGitCheckout.kt @@ -0,0 +1,9 @@ +package org.kson.jsonsuite + +import org.kson.CleanGitCheckout +import java.nio.file.Path + +class JsonSuiteGitCheckout(jsonTestSuiteSHA: String, destinationDir: Path) + : CleanGitCheckout("https://github.com/nst/JSONTestSuite.git", jsonTestSuiteSHA, destinationDir, "JSONTestSuite") +class SchemaSuiteGitCheckout(schemaTestSuiteSHA: String, destinationDir: Path) + : CleanGitCheckout("https://github.com/json-schema-org/JSON-Schema-Test-Suite.git", schemaTestSuiteSHA, destinationDir, "JSON-Schema-Test-Suite") diff --git a/buildSrc/src/test/kotlin/GenerateJsonTestSuiteTaskTest.kt b/buildSrc/src/test/kotlin/GenerateJsonTestSuiteTaskTest.kt index 3cee7fd2..9c86bfb6 100644 --- a/buildSrc/src/test/kotlin/GenerateJsonTestSuiteTaskTest.kt +++ b/buildSrc/src/test/kotlin/GenerateJsonTestSuiteTaskTest.kt @@ -2,16 +2,17 @@ import org.gradle.testfixtures.ProjectBuilder import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue +import org.kson.jsonsuite.JsonTestSuiteGenerator +import org.kson.jsonsuite.JsonTestSuiteGeneratorTest /** - * Note: most of the meat of [GenerateJsonTestSuiteTask]'s implementation lives in - * [org.kson.jsonsuite.JsonTestSuiteGenerator], and is tested more effectively in - * [org.kson.jsonsuite.JsonTestSuiteGeneratorTest] + * Note: most of the meat of [GenerateJsonTestSuiteTask]'s implementation lives in + * [JsonTestSuiteGenerator]. See [JsonTestSuiteGeneratorTest.testPlaceholder] for + * more notes on the testing of these classes */ class GenerateJsonTestSuiteTaskTest { /** - * Basic sanity check test based on the equally [anemic example from the docs](https://docs.gradle.org/current/userguide/custom_tasks.html#sec:writing_tests_for_your_task_class) - * See [org.kson.jsonsuite.JsonTestSuiteGeneratorTest] for more effective testing of the underlying code + * Basic sanity check test based on the [equally basic example from the docs](https://docs.gradle.org/current/userguide/custom_tasks.html#sec:writing_tests_for_your_task_class) */ @Test fun sanityCheckTask() { @@ -20,10 +21,16 @@ class GenerateJsonTestSuiteTaskTest { val jsonGenTask = project.getTasksByName("generateJsonTestSuite", false) .iterator().next() assertTrue(jsonGenTask is GenerateJsonTestSuiteTask) - assertEquals(1, jsonGenTask.getGeneratedTestPath().size, "Should only have one output test file path") + assertEquals(2, jsonGenTask.getGeneratedTestPath().size, "Should have both our test file paths") + assertTrue( jsonGenTask.getGeneratedTestPath()[0].startsWith(project.projectDir), "Should set the output test file path relative to the project directory" ) + + assertTrue( + jsonGenTask.getGeneratedTestPath()[1].startsWith(project.projectDir), + "Should set the output test file path relative to the project directory" + ) } } \ No newline at end of file diff --git a/buildSrc/src/test/kotlin/org/kson/jsonsuite/CleanGitCheckoutTest.kt b/buildSrc/src/test/kotlin/org/kson/jsonsuite/CleanGitCheckoutTest.kt new file mode 100644 index 00000000..d698e10a --- /dev/null +++ b/buildSrc/src/test/kotlin/org/kson/jsonsuite/CleanGitCheckoutTest.kt @@ -0,0 +1,158 @@ +package org.kson.jsonsuite + +import org.eclipse.jgit.api.Git +import org.kson.CleanGitCheckout +import org.kson.DirtyRepoException +import org.kson.NoRepoException +import java.io.File +import java.nio.file.Files.createTempDirectory +import java.nio.file.Paths +import java.util.zip.ZipFile +import kotlin.test.* + +/** + * Unzip the git directory test fixture we prepared for these tests into a temp dir + */ +private val gitTestFixturePath = run { + val gitTestFixtureURI = + ({}.javaClass.getResource("/GitTestFixture.zip")?.file) + ?: throw RuntimeException("Expected to find this test resource!") + + val tmpDir = createTempDirectory("GitTestFixtureUnzipped").toString() + + ZipFile(gitTestFixtureURI).use { zip -> + zip.entries().asSequence().forEach { entry -> + zip.getInputStream(entry).use { input -> + val outputFile = File(tmpDir, entry.name) + if (entry.isDirectory) { + outputFile.mkdirs() + } else { + outputFile.outputStream().use { output -> + input.copyTo(output) + } + } + } + } + } + File(tmpDir, "GitTestFixture").absolutePath +} + +class CleanGitCheckoutTest { + + @Test + fun testCheckoutOnNonExistentDir() { + val testDestinationDir = Paths.get(createTempDirectory("EnsureSuiteSourceFiles").toString()) + val desiredCheckoutSHA = "3a7625fe9e30a63102afbe74b078851ba7b185e7" + + val cleanGitCheckout = CleanGitCheckout( + gitTestFixturePath, + desiredCheckoutSHA, + testDestinationDir, + "GitFixture" + ) + + val repository = Git.open(cleanGitCheckout.checkoutDir).repository + val actualCheckoutSHA = repository.refDatabase.firstExactRef("HEAD").objectId.name + + assertEquals(desiredCheckoutSHA, actualCheckoutSHA, "should have made new dir and checked out the desired SHA") + } + + @Test + fun testEnsureCleanGitCheckoutOnEmptyDir() { + val testDestinationDir = Paths.get(createTempDirectory("EnsureSuiteSourceFiles").toString()) + + val desiredCheckoutSHA = "3a7625fe9e30a63102afbe74b078851ba7b185e7" + + // perform a checkout + val cleanGitCheckout = CleanGitCheckout( + gitTestFixturePath, + desiredCheckoutSHA, + testDestinationDir, + "GitFixture" + ) + + // clean out the files behind the checkout we just made + cleanGitCheckout.checkoutDir.deleteRecursively() + cleanGitCheckout.checkoutDir.mkdir() + + // and try to check it out again... + assertFailsWith("should error on non-git dir") { + CleanGitCheckout( + gitTestFixturePath, + desiredCheckoutSHA, + testDestinationDir, + "GitFixture" + ) + } + } + + @Test + fun testEnsureCleanGitCheckoutOnCleanDir() { + val testDestinationDir = Paths.get(createTempDirectory("EnsureSuiteSourceFiles").toString()) + val desiredCheckoutSHA = "3a7625fe9e30a63102afbe74b078851ba7b185e7" + + val cleanGitCheckout = CleanGitCheckout( + gitTestFixturePath, + desiredCheckoutSHA, + testDestinationDir, + "GitFixture" + ) + + // reach into the checkout we just created and point it another SHA + val repository = Git.open(cleanGitCheckout.checkoutDir).repository + val git = Git(repository) + git.checkout().setName("296892b3392df3adeb7fb14e6b74140a311a1695").call() + val currentRepoSHA = repository.refDatabase.firstExactRef("HEAD").objectId.name + + assertNotEquals( + currentRepoSHA, + desiredCheckoutSHA, + "should not currently be pointed to our desired SHA, " + + "because this test is trying verify we're able to check out our desired SHA from a " + + "clean git repo pointed to another SHA" + ) + + /** + * create a new [CleanGitCheckout] in the same directory demanding our `desiredCheckoutSHA` + */ + CleanGitCheckout( + gitTestFixturePath, + desiredCheckoutSHA, + testDestinationDir, + "GitFixture" + ) + + // this incantation gets us the currently checked out SHA + val actualCheckoutSHA = repository.refDatabase.firstExactRef("HEAD").objectId.name + + assertEquals( + desiredCheckoutSHA, + actualCheckoutSHA, + "should have ensured our desired SHA is checked out") + } + + @Test + fun testEnsureCleanGitCheckoutOnDirtyDir() { + val testCheckoutDir = Paths.get(createTempDirectory("EnsureSuiteSourceFiles").toString()) + val desiredCheckoutSHA = "3a7625fe9e30a63102afbe74b078851ba7b185e7" + + val cleanGitCheckout = CleanGitCheckout( + gitTestFixturePath, + desiredCheckoutSHA, + testCheckoutDir, + "GitFixture" + ) + + // reach into the checkout we just ensured and dirty it up + Paths.get(cleanGitCheckout.checkoutDir.toString(), "dirty.txt").toFile().createNewFile() + + assertFailsWith("should error on a dirty git dir") { + CleanGitCheckout( + gitTestFixturePath, + desiredCheckoutSHA, + testCheckoutDir, + "GitFixture" + ) + } + } +} \ No newline at end of file diff --git a/buildSrc/src/test/kotlin/org/kson/jsonsuite/JsonTestSuiteGeneratorTest.kt b/buildSrc/src/test/kotlin/org/kson/jsonsuite/JsonTestSuiteGeneratorTest.kt index 5b3b9b8c..8afad26d 100644 --- a/buildSrc/src/test/kotlin/org/kson/jsonsuite/JsonTestSuiteGeneratorTest.kt +++ b/buildSrc/src/test/kotlin/org/kson/jsonsuite/JsonTestSuiteGeneratorTest.kt @@ -1,134 +1,56 @@ package org.kson.jsonsuite -import org.eclipse.jgit.api.Git -import java.io.File -import java.nio.file.Files.createTempDirectory -import java.nio.file.Paths -import java.util.zip.ZipFile -import kotlin.test.* - -/** - * Unzip the git directory test fixture we prepared for these tests into a temp dir - */ -private val gitTestFixturePath = run { - val gitTestFixtureURI = - ({}.javaClass.getResource("/GitTestFixture.zip")?.file) - ?: throw RuntimeException("Expected to find this test resource!") - - val tmpDir = createTempDirectory("GitTestFixtureUnzipped").toString() - - ZipFile(gitTestFixtureURI).use { zip -> - zip.entries().asSequence().forEach { entry -> - zip.getInputStream(entry).use { input -> - val outputFile = File(tmpDir, entry.name) - if (entry.isDirectory) { - outputFile.mkdirs() - } else { - outputFile.outputStream().use { output -> - input.copyTo(output) - } - } - } - } - } - File(tmpDir, "GitTestFixture").absolutePath -} +import jsonTestSuiteSHA +import schemaTestSuiteSHA +import kotlin.io.path.createTempDirectory +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue class JsonTestSuiteGeneratorTest { + /** + * Integration test for [JsonTestSuiteGenerator.generate] that runs against actual checkouts of [JSONTestSuite](https://github.com/nst/JSONTestSuite) + * and [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) + * + * TODO: this currently depends on performing actual git clones over the network that may be undesirable/unreliable + * in our tests. We should be able to point these tests to locally cached versions on these repos if/when this + * is a problem + */ @Test - fun testEnsureCleanGitCheckoutOnNonExistentDir() { - val testCheckoutDir = Paths.get(createTempDirectory("EnsureSuiteSourceFiles").toString(), "JSONTestSuite") - val desiredCheckoutSHA = "3a7625fe9e30a63102afbe74b078851ba7b185e7" + fun testGenerate() { + val tempDirectory = createTempDirectory("JsonTestSuiteGeneratorTest") - ensureCleanGitCheckout( - gitTestFixturePath, - desiredCheckoutSHA, - testCheckoutDir - ) + val testPackageName = "org.json.parser.json.generated.TEST" - val repository = Git.open(testCheckoutDir.toFile()).repository - val actualCheckoutSHA = repository.refDatabase.firstExactRef("HEAD").objectId.name + val jsonTestSuiteGenerator = JsonTestSuiteGenerator( + JsonSuiteGitCheckout(jsonTestSuiteSHA, tempDirectory), + SchemaSuiteGitCheckout(schemaTestSuiteSHA, tempDirectory), + tempDirectory, + tempDirectory, + testPackageName) - assertEquals(desiredCheckoutSHA, actualCheckoutSHA, "should have made new dir and checked out the desired SHA") - } + jsonTestSuiteGenerator.generate() - @Test - fun testEnsureCleanGitCheckoutOnEmptyDir() { - val testCheckoutDir = Paths.get(createTempDirectory("EnsureSuiteSourceFiles").toString(), "JSONTestSuite") - - // create the leaf directory we just defined above to ensure it exists, but is empty (and so not a git repo) - testCheckoutDir.toFile().mkdir() - - val desiredCheckoutSHA = "3a7625fe9e30a63102afbe74b078851ba7b185e7" - - assertFailsWith("should error on non-git dir") { - ensureCleanGitCheckout( - gitTestFixturePath, - desiredCheckoutSHA, - testCheckoutDir - ) - } - } - - @Test - fun testEnsureCleanGitCheckoutOnCleanDir() { - val testCheckoutDir = Paths.get(createTempDirectory("EnsureSuiteSourceFiles").toString(), "JSONTestSuite") - val desiredCheckoutSHA = "3a7625fe9e30a63102afbe74b078851ba7b185e7" - - /** - * pre-clone the git repo so we can run [ensureCleanGitCheckout] on it - */ - Git.cloneRepository() - .setURI(gitTestFixturePath) - .setDirectory(testCheckoutDir.toFile()) - .call() - - val repository = Git.open(testCheckoutDir.toFile()).repository - val currentRepoSHA = repository.refDatabase.firstExactRef("HEAD").objectId.name - - assertNotEquals( - currentRepoSHA, - desiredCheckoutSHA, - "should not currently be pointed to our desired SHA," + - "because this test verifies we're able to check out our desired SHA" + assertTrue( + jsonTestSuiteGenerator.jsonTestSourceFilesDir.toFile().isDirectory, + "test suite directory should exist and be a directory" ) - ensureCleanGitCheckout( - gitTestFixturePath, - desiredCheckoutSHA, - testCheckoutDir - ) + val generatedTestContents = jsonTestSuiteGenerator.generatedJsonSuiteTestPath.toFile().readText() - val actualCheckoutSHA = repository.refDatabase.firstExactRef("HEAD").objectId.name + assertTrue( + generatedTestContents + // sanity check this is the test class we expect to be generated by checking its classname + .contains("class JsonSuiteTest"), + "test class should be generated" + ) + val packageNameStartIndex = "package ".length assertEquals( - desiredCheckoutSHA, - actualCheckoutSHA, - "should have ensured our desired SHA is checked out") - } - - @Test - fun testEnsureCleanGitCheckoutOnDirtyDir() { - val testCheckoutDir = Paths.get(createTempDirectory("EnsureSuiteSourceFiles").toString(), "JSONTestSuite") - val desiredCheckoutSHA = "3a7625fe9e30a63102afbe74b078851ba7b185e7" - - /** - * pre-clone the git repo so we can dirty it before running [ensureCleanGitCheckout] - */ - Git.cloneRepository() - .setURI(gitTestFixturePath) - .setDirectory(testCheckoutDir.toFile()) - .call() - - Paths.get(testCheckoutDir.toString(), "dirty.txt").toFile().createNewFile() - - assertFailsWith("should error on a dirty git dir") { - ensureCleanGitCheckout( - gitTestFixturePath, - desiredCheckoutSHA, - testCheckoutDir - ) - } + testPackageName, + generatedTestContents.substring(packageNameStartIndex, packageNameStartIndex + testPackageName.length), + "generated test file should start with configured package declaration" + ) } } \ No newline at end of file diff --git a/buildSrc/support/jsonsuite/.gitignore b/buildSrc/support/jsonsuite/.gitignore index ba7a0747..2ab640f5 100644 --- a/buildSrc/support/jsonsuite/.gitignore +++ b/buildSrc/support/jsonsuite/.gitignore @@ -1,2 +1,3 @@ -# this gets checked out on the fly in `ensure_suite.sh` +# these get checked out on the fly as part of our build /JSONTestSuite/ +/JSON-Schema-Test-Suite/ \ No newline at end of file diff --git a/src/commonMain/kotlin/org/kson/Kson.kt b/src/commonMain/kotlin/org/kson/Kson.kt index d23e39dc..34b3b1fd 100644 --- a/src/commonMain/kotlin/org/kson/Kson.kt +++ b/src/commonMain/kotlin/org/kson/Kson.kt @@ -4,9 +4,20 @@ import org.kson.ast.KsonRoot import org.kson.parser.* import org.kson.parser.messages.MessageType +/** + * A Json document specifying just `true` is the "trivial" schema that matches everything, + * and so is equivalent to not having a schema. See https://json-schema.org/draft/2020-12/json-schema-core#section-4.3.2 + * for more detail + */ +private const val NO_SCHEMA = "true" + class Kson { companion object { fun parse(source: String, maxNestingLevel: Int = DEFAULT_MAX_NESTING_LEVEL): ParseResult { + return parse(source, NO_SCHEMA, maxNestingLevel) + } + + fun parse(source: String, schemaJson: String = NO_SCHEMA, maxNestingLevel: Int = DEFAULT_MAX_NESTING_LEVEL): ParseResult { val messageSink = MessageSink() val tokens = Lexer(source, messageSink).tokenize() if (tokens[0].tokenType == TokenType.EOF) { @@ -22,7 +33,11 @@ class Kson { builder.buildTree(messageSink) } - return ParseResult(ast, tokens, messageSink) + if (schemaJson == NO_SCHEMA) { + return ParseResult(ast, tokens, messageSink) + } else { + TODO("Json Schema support for Kson not yet implemented") + } } } } diff --git a/src/commonTest/kotlin/org/kson/parser/json/generated/SchemaSuiteTest.kt b/src/commonTest/kotlin/org/kson/parser/json/generated/SchemaSuiteTest.kt new file mode 100644 index 00000000..bcdec7ab --- /dev/null +++ b/src/commonTest/kotlin/org/kson/parser/json/generated/SchemaSuiteTest.kt @@ -0,0 +1,20791 @@ +package org.kson.parser.json.generated + +import org.kson.Kson +import kotlin.test.Test +import kotlin.test.assertEquals + +/** + * DO NOT MANUALLY EDIT. This class is GENERATED by `./gradlew generateJsonTestSuite` task + * which calls [org.kson.jsonsuite.JsonTestSuiteGenerator]---see that class for more info. + * + * TODO expand the testing here as we implement Json Schema support by + * removing exclusions from [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ +class SchemaSuiteTest { + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "additionalItems as schema -> additional items match schema" + */ + @Test + fun additionalItems_additionalItemsAsSchema_additionalItemsMatchSchema() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_additionalItemsAsSchema_additionalItemsMatchSchema" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [null,2,3,4] + """, + """ + {"items":[{}],"additionalItems":{"type":"integer"}} + """, + true, + """additionalItems as schema -> additional items match schema""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "additionalItems as schema -> additional items do not match schema" + */ + @Test + fun additionalItems_additionalItemsAsSchema_additionalItemsDoNotMatchSchema() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_additionalItemsAsSchema_additionalItemsDoNotMatchSchema" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [null,2,3,"foo"] + """, + """ + {"items":[{}],"additionalItems":{"type":"integer"}} + """, + false, + """additionalItems as schema -> additional items do not match schema""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "when items is schema, additionalItems does nothing -> valid with a array of type integers" + */ + @Test + fun additionalItems_whenItemsIsSchema_AdditionalItemsDoesNothing_validWithAArrayOfTypeIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_whenItemsIsSchema_AdditionalItemsDoesNothing_validWithAArrayOfTypeIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3] + """, + """ + {"items":{"type":"integer"},"additionalItems":{"type":"string"}} + """, + true, + """when items is schema, additionalItems does nothing -> valid with a array of type integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "when items is schema, additionalItems does nothing -> invalid with a array of mixed types" + */ + @Test + fun additionalItems_whenItemsIsSchema_AdditionalItemsDoesNothing_invalidWithAArrayOfMixedTypes() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_whenItemsIsSchema_AdditionalItemsDoesNothing_invalidWithAArrayOfMixedTypes" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,"2","3"] + """, + """ + {"items":{"type":"integer"},"additionalItems":{"type":"string"}} + """, + false, + """when items is schema, additionalItems does nothing -> invalid with a array of mixed types""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "when items is schema, boolean additionalItems does nothing -> all items match schema" + */ + @Test + fun additionalItems_whenItemsIsSchema_BooleanAdditionalItemsDoesNothing_allItemsMatchSchema() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_whenItemsIsSchema_BooleanAdditionalItemsDoesNothing_allItemsMatchSchema" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3,4,5] + """, + """ + {"items":{},"additionalItems":false} + """, + true, + """when items is schema, boolean additionalItems does nothing -> all items match schema""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "array of items with no additionalItems permitted -> empty array" + */ + @Test + fun additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_emptyArray() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_emptyArray" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"items":[{},{},{}],"additionalItems":false} + """, + true, + """array of items with no additionalItems permitted -> empty array""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "array of items with no additionalItems permitted -> fewer number of items present (1)" + */ + @Test + fun additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_fewerNumberOfItemsPresent_1_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_fewerNumberOfItemsPresent_1_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1] + """, + """ + {"items":[{},{},{}],"additionalItems":false} + """, + true, + """array of items with no additionalItems permitted -> fewer number of items present (1)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "array of items with no additionalItems permitted -> fewer number of items present (2)" + */ + @Test + fun additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_fewerNumberOfItemsPresent_2_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_fewerNumberOfItemsPresent_2_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2] + """, + """ + {"items":[{},{},{}],"additionalItems":false} + """, + true, + """array of items with no additionalItems permitted -> fewer number of items present (2)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "array of items with no additionalItems permitted -> equal number of items present" + */ + @Test + fun additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_equalNumberOfItemsPresent() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_equalNumberOfItemsPresent" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3] + """, + """ + {"items":[{},{},{}],"additionalItems":false} + """, + true, + """array of items with no additionalItems permitted -> equal number of items present""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "array of items with no additionalItems permitted -> additional items are not permitted" + */ + @Test + fun additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_additionalItemsAreNotPermitted() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_arrayOfItemsWithNoAdditionalItemsPermitted_additionalItemsAreNotPermitted" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3,4] + """, + """ + {"items":[{},{},{}],"additionalItems":false} + """, + false, + """array of items with no additionalItems permitted -> additional items are not permitted""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "additionalItems as false without items -> items defaults to empty schema so everything is valid" + */ + @Test + fun additionalItems_additionalItemsAsFalseWithoutItems_itemsDefaultsToEmptySchemaSoEverythingIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_additionalItemsAsFalseWithoutItems_itemsDefaultsToEmptySchemaSoEverythingIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3,4,5] + """, + """ + {"additionalItems":false} + """, + true, + """additionalItems as false without items -> items defaults to empty schema so everything is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "additionalItems as false without items -> ignores non-arrays" + */ + @Test + fun additionalItems_additionalItemsAsFalseWithoutItems_ignoresNon_arrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_additionalItemsAsFalseWithoutItems_ignoresNon_arrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"additionalItems":false} + """, + true, + """additionalItems as false without items -> ignores non-arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "additionalItems are allowed by default -> only the first item is validated" + */ + @Test + fun additionalItems_additionalItemsAreAllowedByDefault_onlyTheFirstItemIsValidated() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_additionalItemsAreAllowedByDefault_onlyTheFirstItemIsValidated" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,"foo",false] + """, + """ + {"items":[{"type":"integer"}]} + """, + true, + """additionalItems are allowed by default -> only the first item is validated""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "additionalItems does not look in applicators, valid case -> items defined in allOf are not examined" + */ + @Test + fun additionalItems_additionalItemsDoesNotLookInApplicators_ValidCase_itemsDefinedInAllOfAreNotExamined() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_additionalItemsDoesNotLookInApplicators_ValidCase_itemsDefinedInAllOfAreNotExamined" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,null] + """, + """ + {"allOf":[{"items":[{"type":"integer"}]}],"additionalItems":{"type":"boolean"}} + """, + true, + """additionalItems does not look in applicators, valid case -> items defined in allOf are not examined""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "additionalItems does not look in applicators, invalid case -> items defined in allOf are not examined" + */ + @Test + fun additionalItems_additionalItemsDoesNotLookInApplicators_InvalidCase_itemsDefinedInAllOfAreNotExamined() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_additionalItemsDoesNotLookInApplicators_InvalidCase_itemsDefinedInAllOfAreNotExamined" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,"hello"] + """, + """ + {"allOf":[{"items":[{"type":"integer"},{"type":"string"}]}],"items":[{"type":"integer"}],"additionalItems":{"type":"boolean"}} + """, + false, + """additionalItems does not look in applicators, invalid case -> items defined in allOf are not examined""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "items validation adjusts the starting index for additionalItems -> valid items" + */ + @Test + fun additionalItems_itemsValidationAdjustsTheStartingIndexForAdditionalItems_validItems() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_itemsValidationAdjustsTheStartingIndexForAdditionalItems_validItems" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["x",2,3] + """, + """ + {"items":[{"type":"string"}],"additionalItems":{"type":"integer"}} + """, + true, + """items validation adjusts the starting index for additionalItems -> valid items""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "items validation adjusts the starting index for additionalItems -> wrong type of second item" + */ + @Test + fun additionalItems_itemsValidationAdjustsTheStartingIndexForAdditionalItems_wrongTypeOfSecondItem() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_itemsValidationAdjustsTheStartingIndexForAdditionalItems_wrongTypeOfSecondItem" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["x","y"] + """, + """ + {"items":[{"type":"string"}],"additionalItems":{"type":"integer"}} + """, + false, + """items validation adjusts the starting index for additionalItems -> wrong type of second item""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "additionalItems with heterogeneous array -> heterogeneous invalid instance" + */ + @Test + fun additionalItems_additionalItemsWithHeterogeneousArray_heterogeneousInvalidInstance() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_additionalItemsWithHeterogeneousArray_heterogeneousInvalidInstance" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["foo","bar",37] + """, + """ + {"items":[{}],"additionalItems":false} + """, + false, + """additionalItems with heterogeneous array -> heterogeneous invalid instance""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "additionalItems with heterogeneous array -> valid instance" + */ + @Test + fun additionalItems_additionalItemsWithHeterogeneousArray_validInstance() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_additionalItemsWithHeterogeneousArray_validInstance" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [null] + """, + """ + {"items":[{}],"additionalItems":false} + """, + true, + """additionalItems with heterogeneous array -> valid instance""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalItems.json`: + * "additionalItems with null instance elements -> allows null elements" + */ + @Test + fun additionalItems_additionalItemsWithNullInstanceElements_allowsNullElements() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalItems_additionalItemsWithNullInstanceElements_allowsNullElements" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [null] + """, + """ + {"additionalItems":{"type":"null"}} + """, + true, + """additionalItems with null instance elements -> allows null elements""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties being false does not allow other properties -> no additional properties is valid" + */ + @Test + fun additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_noAdditionalPropertiesIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_noAdditionalPropertiesIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"properties":{"foo":{},"bar":{}},"patternProperties":{"^v":{}},"additionalProperties":false} + """, + true, + """additionalProperties being false does not allow other properties -> no additional properties is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties being false does not allow other properties -> an additional property is invalid" + */ + @Test + fun additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_anAdditionalPropertyIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_anAdditionalPropertyIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2,"quux":"boom"} + """, + """ + {"properties":{"foo":{},"bar":{}},"patternProperties":{"^v":{}},"additionalProperties":false} + """, + false, + """additionalProperties being false does not allow other properties -> an additional property is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties being false does not allow other properties -> ignores arrays" + */ + @Test + fun additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_ignoresArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_ignoresArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3] + """, + """ + {"properties":{"foo":{},"bar":{}},"patternProperties":{"^v":{}},"additionalProperties":false} + """, + true, + """additionalProperties being false does not allow other properties -> ignores arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties being false does not allow other properties -> ignores strings" + */ + @Test + fun additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_ignoresStrings() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_ignoresStrings" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foobarbaz" + """, + """ + {"properties":{"foo":{},"bar":{}},"patternProperties":{"^v":{}},"additionalProperties":false} + """, + true, + """additionalProperties being false does not allow other properties -> ignores strings""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties being false does not allow other properties -> ignores other non-objects" + */ + @Test + fun additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_ignoresOtherNon_objects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_ignoresOtherNon_objects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"properties":{"foo":{},"bar":{}},"patternProperties":{"^v":{}},"additionalProperties":false} + """, + true, + """additionalProperties being false does not allow other properties -> ignores other non-objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties being false does not allow other properties -> patternProperties are not additional properties" + */ + @Test + fun additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_patternPropertiesAreNotAdditionalProperties() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesBeingFalseDoesNotAllowOtherProperties_patternPropertiesAreNotAdditionalProperties" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"vroom":2} + """, + """ + {"properties":{"foo":{},"bar":{}},"patternProperties":{"^v":{}},"additionalProperties":false} + """, + true, + """additionalProperties being false does not allow other properties -> patternProperties are not additional properties""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "non-ASCII pattern with additionalProperties -> matching the pattern is valid" + */ + @Test + fun additionalProperties_non_ASCIIPatternWithAdditionalProperties_matchingThePatternIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_non_ASCIIPatternWithAdditionalProperties_matchingThePatternIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"ármányos":2} + """, + """ + {"patternProperties":{"^á":{}},"additionalProperties":false} + """, + true, + """non-ASCII pattern with additionalProperties -> matching the pattern is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "non-ASCII pattern with additionalProperties -> not matching the pattern is invalid" + */ + @Test + fun additionalProperties_non_ASCIIPatternWithAdditionalProperties_notMatchingThePatternIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_non_ASCIIPatternWithAdditionalProperties_notMatchingThePatternIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"élmény":2} + """, + """ + {"patternProperties":{"^á":{}},"additionalProperties":false} + """, + false, + """non-ASCII pattern with additionalProperties -> not matching the pattern is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties with schema -> no additional properties is valid" + */ + @Test + fun additionalProperties_additionalPropertiesWithSchema_noAdditionalPropertiesIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesWithSchema_noAdditionalPropertiesIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"properties":{"foo":{},"bar":{}},"additionalProperties":{"type":"boolean"}} + """, + true, + """additionalProperties with schema -> no additional properties is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties with schema -> an additional valid property is valid" + */ + @Test + fun additionalProperties_additionalPropertiesWithSchema_anAdditionalValidPropertyIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesWithSchema_anAdditionalValidPropertyIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2,"quux":true} + """, + """ + {"properties":{"foo":{},"bar":{}},"additionalProperties":{"type":"boolean"}} + """, + true, + """additionalProperties with schema -> an additional valid property is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties with schema -> an additional invalid property is invalid" + */ + @Test + fun additionalProperties_additionalPropertiesWithSchema_anAdditionalInvalidPropertyIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesWithSchema_anAdditionalInvalidPropertyIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2,"quux":12} + """, + """ + {"properties":{"foo":{},"bar":{}},"additionalProperties":{"type":"boolean"}} + """, + false, + """additionalProperties with schema -> an additional invalid property is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties can exist by itself -> an additional valid property is valid" + */ + @Test + fun additionalProperties_additionalPropertiesCanExistByItself_anAdditionalValidPropertyIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesCanExistByItself_anAdditionalValidPropertyIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":true} + """, + """ + {"additionalProperties":{"type":"boolean"}} + """, + true, + """additionalProperties can exist by itself -> an additional valid property is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties can exist by itself -> an additional invalid property is invalid" + */ + @Test + fun additionalProperties_additionalPropertiesCanExistByItself_anAdditionalInvalidPropertyIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesCanExistByItself_anAdditionalInvalidPropertyIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"additionalProperties":{"type":"boolean"}} + """, + false, + """additionalProperties can exist by itself -> an additional invalid property is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties are allowed by default -> additional properties are allowed" + */ + @Test + fun additionalProperties_additionalPropertiesAreAllowedByDefault_additionalPropertiesAreAllowed() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesAreAllowedByDefault_additionalPropertiesAreAllowed" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2,"quux":true} + """, + """ + {"properties":{"foo":{},"bar":{}}} + """, + true, + """additionalProperties are allowed by default -> additional properties are allowed""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties does not look in applicators -> properties defined in allOf are not examined" + */ + @Test + fun additionalProperties_additionalPropertiesDoesNotLookInApplicators_propertiesDefinedInAllOfAreNotExamined() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesDoesNotLookInApplicators_propertiesDefinedInAllOfAreNotExamined" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":true} + """, + """ + {"allOf":[{"properties":{"foo":{}}}],"additionalProperties":{"type":"boolean"}} + """, + false, + """additionalProperties does not look in applicators -> properties defined in allOf are not examined""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/additionalProperties.json`: + * "additionalProperties with null valued instance properties -> allows null values" + */ + @Test + fun additionalProperties_additionalPropertiesWithNullValuedInstanceProperties_allowsNullValues() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "additionalProperties_additionalPropertiesWithNullValuedInstanceProperties_allowsNullValues" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":null} + """, + """ + {"additionalProperties":{"type":"null"}} + """, + true, + """additionalProperties with null valued instance properties -> allows null values""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf -> allOf" + */ + @Test + fun allOf_allOf_allOf() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOf_allOf" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"baz","bar":2} + """, + """ + {"allOf":[{"properties":{"bar":{"type":"integer"}},"required":["bar"]},{"properties":{"foo":{"type":"string"}},"required":["foo"]}]} + """, + true, + """allOf -> allOf""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf -> mismatch second" + */ + @Test + fun allOf_allOf_mismatchSecond() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOf_mismatchSecond" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"baz"} + """, + """ + {"allOf":[{"properties":{"bar":{"type":"integer"}},"required":["bar"]},{"properties":{"foo":{"type":"string"}},"required":["foo"]}]} + """, + false, + """allOf -> mismatch second""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf -> mismatch first" + */ + @Test + fun allOf_allOf_mismatchFirst() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOf_mismatchFirst" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":2} + """, + """ + {"allOf":[{"properties":{"bar":{"type":"integer"}},"required":["bar"]},{"properties":{"foo":{"type":"string"}},"required":["foo"]}]} + """, + false, + """allOf -> mismatch first""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf -> wrong type" + */ + @Test + fun allOf_allOf_wrongType() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOf_wrongType" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"baz","bar":"quux"} + """, + """ + {"allOf":[{"properties":{"bar":{"type":"integer"}},"required":["bar"]},{"properties":{"foo":{"type":"string"}},"required":["foo"]}]} + """, + false, + """allOf -> wrong type""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with base schema -> valid" + */ + @Test + fun allOf_allOfWithBaseSchema_valid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithBaseSchema_valid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"quux","bar":2,"baz":null} + """, + """ + {"properties":{"bar":{"type":"integer"}},"required":["bar"],"allOf":[{"properties":{"foo":{"type":"string"}},"required":["foo"]},{"properties":{"baz":{"type":"null"}},"required":["baz"]}]} + """, + true, + """allOf with base schema -> valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with base schema -> mismatch base schema" + */ + @Test + fun allOf_allOfWithBaseSchema_mismatchBaseSchema() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithBaseSchema_mismatchBaseSchema" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"quux","baz":null} + """, + """ + {"properties":{"bar":{"type":"integer"}},"required":["bar"],"allOf":[{"properties":{"foo":{"type":"string"}},"required":["foo"]},{"properties":{"baz":{"type":"null"}},"required":["baz"]}]} + """, + false, + """allOf with base schema -> mismatch base schema""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with base schema -> mismatch first allOf" + */ + @Test + fun allOf_allOfWithBaseSchema_mismatchFirstAllOf() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithBaseSchema_mismatchFirstAllOf" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":2,"baz":null} + """, + """ + {"properties":{"bar":{"type":"integer"}},"required":["bar"],"allOf":[{"properties":{"foo":{"type":"string"}},"required":["foo"]},{"properties":{"baz":{"type":"null"}},"required":["baz"]}]} + """, + false, + """allOf with base schema -> mismatch first allOf""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with base schema -> mismatch second allOf" + */ + @Test + fun allOf_allOfWithBaseSchema_mismatchSecondAllOf() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithBaseSchema_mismatchSecondAllOf" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"quux","bar":2} + """, + """ + {"properties":{"bar":{"type":"integer"}},"required":["bar"],"allOf":[{"properties":{"foo":{"type":"string"}},"required":["foo"]},{"properties":{"baz":{"type":"null"}},"required":["baz"]}]} + """, + false, + """allOf with base schema -> mismatch second allOf""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with base schema -> mismatch both" + */ + @Test + fun allOf_allOfWithBaseSchema_mismatchBoth() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithBaseSchema_mismatchBoth" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":2} + """, + """ + {"properties":{"bar":{"type":"integer"}},"required":["bar"],"allOf":[{"properties":{"foo":{"type":"string"}},"required":["foo"]},{"properties":{"baz":{"type":"null"}},"required":["baz"]}]} + """, + false, + """allOf with base schema -> mismatch both""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf simple types -> valid" + */ + @Test + fun allOf_allOfSimpleTypes_valid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfSimpleTypes_valid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 25 + """, + """ + {"allOf":[{"maximum":30},{"minimum":20}]} + """, + true, + """allOf simple types -> valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf simple types -> mismatch one" + */ + @Test + fun allOf_allOfSimpleTypes_mismatchOne() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfSimpleTypes_mismatchOne" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 35 + """, + """ + {"allOf":[{"maximum":30},{"minimum":20}]} + """, + false, + """allOf simple types -> mismatch one""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with boolean schemas, all true -> any value is valid" + */ + @Test + fun allOf_allOfWithBooleanSchemas_AllTrue_anyValueIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithBooleanSchemas_AllTrue_anyValueIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"allOf":[true,true]} + """, + true, + """allOf with boolean schemas, all true -> any value is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with boolean schemas, some false -> any value is invalid" + */ + @Test + fun allOf_allOfWithBooleanSchemas_SomeFalse_anyValueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithBooleanSchemas_SomeFalse_anyValueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"allOf":[true,false]} + """, + false, + """allOf with boolean schemas, some false -> any value is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with boolean schemas, all false -> any value is invalid" + */ + @Test + fun allOf_allOfWithBooleanSchemas_AllFalse_anyValueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithBooleanSchemas_AllFalse_anyValueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"allOf":[false,false]} + """, + false, + """allOf with boolean schemas, all false -> any value is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with one empty schema -> any data is valid" + */ + @Test + fun allOf_allOfWithOneEmptySchema_anyDataIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithOneEmptySchema_anyDataIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"allOf":[{}]} + """, + true, + """allOf with one empty schema -> any data is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with two empty schemas -> any data is valid" + */ + @Test + fun allOf_allOfWithTwoEmptySchemas_anyDataIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithTwoEmptySchemas_anyDataIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"allOf":[{},{}]} + """, + true, + """allOf with two empty schemas -> any data is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with the first empty schema -> number is valid" + */ + @Test + fun allOf_allOfWithTheFirstEmptySchema_numberIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithTheFirstEmptySchema_numberIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"allOf":[{},{"type":"number"}]} + """, + true, + """allOf with the first empty schema -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with the first empty schema -> string is invalid" + */ + @Test + fun allOf_allOfWithTheFirstEmptySchema_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithTheFirstEmptySchema_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"allOf":[{},{"type":"number"}]} + """, + false, + """allOf with the first empty schema -> string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with the last empty schema -> number is valid" + */ + @Test + fun allOf_allOfWithTheLastEmptySchema_numberIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithTheLastEmptySchema_numberIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"allOf":[{"type":"number"},{}]} + """, + true, + """allOf with the last empty schema -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf with the last empty schema -> string is invalid" + */ + @Test + fun allOf_allOfWithTheLastEmptySchema_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfWithTheLastEmptySchema_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"allOf":[{"type":"number"},{}]} + """, + false, + """allOf with the last empty schema -> string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "nested allOf, to check validation semantics -> null is valid" + */ + @Test + fun allOf_nestedAllOf_ToCheckValidationSemantics_nullIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_nestedAllOf_ToCheckValidationSemantics_nullIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"allOf":[{"allOf":[{"type":"null"}]}]} + """, + true, + """nested allOf, to check validation semantics -> null is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "nested allOf, to check validation semantics -> anything non-null is invalid" + */ + @Test + fun allOf_nestedAllOf_ToCheckValidationSemantics_anythingNon_nullIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_nestedAllOf_ToCheckValidationSemantics_anythingNon_nullIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 123 + """, + """ + {"allOf":[{"allOf":[{"type":"null"}]}]} + """, + false, + """nested allOf, to check validation semantics -> anything non-null is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf combined with anyOf, oneOf -> allOf: false, anyOf: false, oneOf: false" + */ + @Test + fun allOf_allOfCombinedWithAnyOf_OneOf_allOf_False_AnyOf_False_OneOf_False() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfCombinedWithAnyOf_OneOf_allOf_False_AnyOf_False_OneOf_False" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"allOf":[{"multipleOf":2}],"anyOf":[{"multipleOf":3}],"oneOf":[{"multipleOf":5}]} + """, + false, + """allOf combined with anyOf, oneOf -> allOf: false, anyOf: false, oneOf: false""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf combined with anyOf, oneOf -> allOf: false, anyOf: false, oneOf: true" + */ + @Test + fun allOf_allOfCombinedWithAnyOf_OneOf_allOf_False_AnyOf_False_OneOf_True() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfCombinedWithAnyOf_OneOf_allOf_False_AnyOf_False_OneOf_True" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 5 + """, + """ + {"allOf":[{"multipleOf":2}],"anyOf":[{"multipleOf":3}],"oneOf":[{"multipleOf":5}]} + """, + false, + """allOf combined with anyOf, oneOf -> allOf: false, anyOf: false, oneOf: true""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf combined with anyOf, oneOf -> allOf: false, anyOf: true, oneOf: false" + */ + @Test + fun allOf_allOfCombinedWithAnyOf_OneOf_allOf_False_AnyOf_True_OneOf_False() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfCombinedWithAnyOf_OneOf_allOf_False_AnyOf_True_OneOf_False" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3 + """, + """ + {"allOf":[{"multipleOf":2}],"anyOf":[{"multipleOf":3}],"oneOf":[{"multipleOf":5}]} + """, + false, + """allOf combined with anyOf, oneOf -> allOf: false, anyOf: true, oneOf: false""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf combined with anyOf, oneOf -> allOf: false, anyOf: true, oneOf: true" + */ + @Test + fun allOf_allOfCombinedWithAnyOf_OneOf_allOf_False_AnyOf_True_OneOf_True() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfCombinedWithAnyOf_OneOf_allOf_False_AnyOf_True_OneOf_True" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 15 + """, + """ + {"allOf":[{"multipleOf":2}],"anyOf":[{"multipleOf":3}],"oneOf":[{"multipleOf":5}]} + """, + false, + """allOf combined with anyOf, oneOf -> allOf: false, anyOf: true, oneOf: true""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf combined with anyOf, oneOf -> allOf: true, anyOf: false, oneOf: false" + */ + @Test + fun allOf_allOfCombinedWithAnyOf_OneOf_allOf_True_AnyOf_False_OneOf_False() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfCombinedWithAnyOf_OneOf_allOf_True_AnyOf_False_OneOf_False" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 2 + """, + """ + {"allOf":[{"multipleOf":2}],"anyOf":[{"multipleOf":3}],"oneOf":[{"multipleOf":5}]} + """, + false, + """allOf combined with anyOf, oneOf -> allOf: true, anyOf: false, oneOf: false""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf combined with anyOf, oneOf -> allOf: true, anyOf: false, oneOf: true" + */ + @Test + fun allOf_allOfCombinedWithAnyOf_OneOf_allOf_True_AnyOf_False_OneOf_True() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfCombinedWithAnyOf_OneOf_allOf_True_AnyOf_False_OneOf_True" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 10 + """, + """ + {"allOf":[{"multipleOf":2}],"anyOf":[{"multipleOf":3}],"oneOf":[{"multipleOf":5}]} + """, + false, + """allOf combined with anyOf, oneOf -> allOf: true, anyOf: false, oneOf: true""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf combined with anyOf, oneOf -> allOf: true, anyOf: true, oneOf: false" + */ + @Test + fun allOf_allOfCombinedWithAnyOf_OneOf_allOf_True_AnyOf_True_OneOf_False() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfCombinedWithAnyOf_OneOf_allOf_True_AnyOf_True_OneOf_False" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 6 + """, + """ + {"allOf":[{"multipleOf":2}],"anyOf":[{"multipleOf":3}],"oneOf":[{"multipleOf":5}]} + """, + false, + """allOf combined with anyOf, oneOf -> allOf: true, anyOf: true, oneOf: false""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/allOf.json`: + * "allOf combined with anyOf, oneOf -> allOf: true, anyOf: true, oneOf: true" + */ + @Test + fun allOf_allOfCombinedWithAnyOf_OneOf_allOf_True_AnyOf_True_OneOf_True() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "allOf_allOfCombinedWithAnyOf_OneOf_allOf_True_AnyOf_True_OneOf_True" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 30 + """, + """ + {"allOf":[{"multipleOf":2}],"anyOf":[{"multipleOf":3}],"oneOf":[{"multipleOf":5}]} + """, + true, + """allOf combined with anyOf, oneOf -> allOf: true, anyOf: true, oneOf: true""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf -> first anyOf valid" + */ + @Test + fun anyOf_anyOf_firstAnyOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOf_firstAnyOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"anyOf":[{"type":"integer"},{"minimum":2}]} + """, + true, + """anyOf -> first anyOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf -> second anyOf valid" + */ + @Test + fun anyOf_anyOf_secondAnyOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOf_secondAnyOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 2.5 + """, + """ + {"anyOf":[{"type":"integer"},{"minimum":2}]} + """, + true, + """anyOf -> second anyOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf -> both anyOf valid" + */ + @Test + fun anyOf_anyOf_bothAnyOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOf_bothAnyOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3 + """, + """ + {"anyOf":[{"type":"integer"},{"minimum":2}]} + """, + true, + """anyOf -> both anyOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf -> neither anyOf valid" + */ + @Test + fun anyOf_anyOf_neitherAnyOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOf_neitherAnyOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.5 + """, + """ + {"anyOf":[{"type":"integer"},{"minimum":2}]} + """, + false, + """anyOf -> neither anyOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf with base schema -> mismatch base schema" + */ + @Test + fun anyOf_anyOfWithBaseSchema_mismatchBaseSchema() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOfWithBaseSchema_mismatchBaseSchema" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3 + """, + """ + {"type":"string","anyOf":[{"maxLength":2},{"minLength":4}]} + """, + false, + """anyOf with base schema -> mismatch base schema""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf with base schema -> one anyOf valid" + */ + @Test + fun anyOf_anyOfWithBaseSchema_oneAnyOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOfWithBaseSchema_oneAnyOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foobar" + """, + """ + {"type":"string","anyOf":[{"maxLength":2},{"minLength":4}]} + """, + true, + """anyOf with base schema -> one anyOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf with base schema -> both anyOf invalid" + */ + @Test + fun anyOf_anyOfWithBaseSchema_bothAnyOfInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOfWithBaseSchema_bothAnyOfInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":"string","anyOf":[{"maxLength":2},{"minLength":4}]} + """, + false, + """anyOf with base schema -> both anyOf invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf with boolean schemas, all true -> any value is valid" + */ + @Test + fun anyOf_anyOfWithBooleanSchemas_AllTrue_anyValueIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOfWithBooleanSchemas_AllTrue_anyValueIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"anyOf":[true,true]} + """, + true, + """anyOf with boolean schemas, all true -> any value is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf with boolean schemas, some true -> any value is valid" + */ + @Test + fun anyOf_anyOfWithBooleanSchemas_SomeTrue_anyValueIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOfWithBooleanSchemas_SomeTrue_anyValueIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"anyOf":[true,false]} + """, + true, + """anyOf with boolean schemas, some true -> any value is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf with boolean schemas, all false -> any value is invalid" + */ + @Test + fun anyOf_anyOfWithBooleanSchemas_AllFalse_anyValueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOfWithBooleanSchemas_AllFalse_anyValueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"anyOf":[false,false]} + """, + false, + """anyOf with boolean schemas, all false -> any value is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf complex types -> first anyOf valid (complex)" + */ + @Test + fun anyOf_anyOfComplexTypes_firstAnyOfValid_complex_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOfComplexTypes_firstAnyOfValid_complex_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":2} + """, + """ + {"anyOf":[{"properties":{"bar":{"type":"integer"}},"required":["bar"]},{"properties":{"foo":{"type":"string"}},"required":["foo"]}]} + """, + true, + """anyOf complex types -> first anyOf valid (complex)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf complex types -> second anyOf valid (complex)" + */ + @Test + fun anyOf_anyOfComplexTypes_secondAnyOfValid_complex_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOfComplexTypes_secondAnyOfValid_complex_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"baz"} + """, + """ + {"anyOf":[{"properties":{"bar":{"type":"integer"}},"required":["bar"]},{"properties":{"foo":{"type":"string"}},"required":["foo"]}]} + """, + true, + """anyOf complex types -> second anyOf valid (complex)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf complex types -> both anyOf valid (complex)" + */ + @Test + fun anyOf_anyOfComplexTypes_bothAnyOfValid_complex_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOfComplexTypes_bothAnyOfValid_complex_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"baz","bar":2} + """, + """ + {"anyOf":[{"properties":{"bar":{"type":"integer"}},"required":["bar"]},{"properties":{"foo":{"type":"string"}},"required":["foo"]}]} + """, + true, + """anyOf complex types -> both anyOf valid (complex)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf complex types -> neither anyOf valid (complex)" + */ + @Test + fun anyOf_anyOfComplexTypes_neitherAnyOfValid_complex_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOfComplexTypes_neitherAnyOfValid_complex_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":2,"bar":"quux"} + """, + """ + {"anyOf":[{"properties":{"bar":{"type":"integer"}},"required":["bar"]},{"properties":{"foo":{"type":"string"}},"required":["foo"]}]} + """, + false, + """anyOf complex types -> neither anyOf valid (complex)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf with one empty schema -> string is valid" + */ + @Test + fun anyOf_anyOfWithOneEmptySchema_stringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOfWithOneEmptySchema_stringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"anyOf":[{"type":"number"},{}]} + """, + true, + """anyOf with one empty schema -> string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "anyOf with one empty schema -> number is valid" + */ + @Test + fun anyOf_anyOfWithOneEmptySchema_numberIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_anyOfWithOneEmptySchema_numberIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 123 + """, + """ + {"anyOf":[{"type":"number"},{}]} + """, + true, + """anyOf with one empty schema -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "nested anyOf, to check validation semantics -> null is valid" + */ + @Test + fun anyOf_nestedAnyOf_ToCheckValidationSemantics_nullIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_nestedAnyOf_ToCheckValidationSemantics_nullIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"anyOf":[{"anyOf":[{"type":"null"}]}]} + """, + true, + """nested anyOf, to check validation semantics -> null is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/anyOf.json`: + * "nested anyOf, to check validation semantics -> anything non-null is invalid" + */ + @Test + fun anyOf_nestedAnyOf_ToCheckValidationSemantics_anythingNon_nullIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "anyOf_nestedAnyOf_ToCheckValidationSemantics_anythingNon_nullIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 123 + """, + """ + {"anyOf":[{"anyOf":[{"type":"null"}]}]} + """, + false, + """nested anyOf, to check validation semantics -> anything non-null is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'true' -> number is valid" + */ + @Test + fun boolean_schema_booleanSchema_true__numberIsValid() { + assertKsonEnforcesSchema( + """ + 1 + """, + """ + true + """, + true, + """boolean schema 'true' -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'true' -> string is valid" + */ + @Test + fun boolean_schema_booleanSchema_true__stringIsValid() { + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + true + """, + true, + """boolean schema 'true' -> string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'true' -> boolean true is valid" + */ + @Test + fun boolean_schema_booleanSchema_true__booleanTrueIsValid() { + assertKsonEnforcesSchema( + """ + true + """, + """ + true + """, + true, + """boolean schema 'true' -> boolean true is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'true' -> boolean false is valid" + */ + @Test + fun boolean_schema_booleanSchema_true__booleanFalseIsValid() { + assertKsonEnforcesSchema( + """ + false + """, + """ + true + """, + true, + """boolean schema 'true' -> boolean false is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'true' -> null is valid" + */ + @Test + fun boolean_schema_booleanSchema_true__nullIsValid() { + assertKsonEnforcesSchema( + """ + null + """, + """ + true + """, + true, + """boolean schema 'true' -> null is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'true' -> object is valid" + */ + @Test + fun boolean_schema_booleanSchema_true__objectIsValid() { + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + true + """, + true, + """boolean schema 'true' -> object is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'true' -> empty object is valid" + */ + @Test + fun boolean_schema_booleanSchema_true__emptyObjectIsValid() { + assertKsonEnforcesSchema( + """ + {} + """, + """ + true + """, + true, + """boolean schema 'true' -> empty object is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'true' -> array is valid" + */ + @Test + fun boolean_schema_booleanSchema_true__arrayIsValid() { + assertKsonEnforcesSchema( + """ + ["foo"] + """, + """ + true + """, + true, + """boolean schema 'true' -> array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'true' -> empty array is valid" + */ + @Test + fun boolean_schema_booleanSchema_true__emptyArrayIsValid() { + assertKsonEnforcesSchema( + """ + [] + """, + """ + true + """, + true, + """boolean schema 'true' -> empty array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'false' -> number is invalid" + */ + @Test + fun boolean_schema_booleanSchema_false__numberIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "boolean_schema_booleanSchema_false__numberIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + false + """, + false, + """boolean schema 'false' -> number is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'false' -> string is invalid" + */ + @Test + fun boolean_schema_booleanSchema_false__stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "boolean_schema_booleanSchema_false__stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + false + """, + false, + """boolean schema 'false' -> string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'false' -> boolean true is invalid" + */ + @Test + fun boolean_schema_booleanSchema_false__booleanTrueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "boolean_schema_booleanSchema_false__booleanTrueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + false + """, + false, + """boolean schema 'false' -> boolean true is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'false' -> boolean false is invalid" + */ + @Test + fun boolean_schema_booleanSchema_false__booleanFalseIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "boolean_schema_booleanSchema_false__booleanFalseIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + false + """, + false, + """boolean schema 'false' -> boolean false is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'false' -> null is invalid" + */ + @Test + fun boolean_schema_booleanSchema_false__nullIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "boolean_schema_booleanSchema_false__nullIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + false + """, + false, + """boolean schema 'false' -> null is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'false' -> object is invalid" + */ + @Test + fun boolean_schema_booleanSchema_false__objectIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "boolean_schema_booleanSchema_false__objectIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + false + """, + false, + """boolean schema 'false' -> object is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'false' -> empty object is invalid" + */ + @Test + fun boolean_schema_booleanSchema_false__emptyObjectIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "boolean_schema_booleanSchema_false__emptyObjectIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + false + """, + false, + """boolean schema 'false' -> empty object is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'false' -> array is invalid" + */ + @Test + fun boolean_schema_booleanSchema_false__arrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "boolean_schema_booleanSchema_false__arrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["foo"] + """, + """ + false + """, + false, + """boolean schema 'false' -> array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/boolean_schema.json`: + * "boolean schema 'false' -> empty array is invalid" + */ + @Test + fun boolean_schema_booleanSchema_false__emptyArrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "boolean_schema_booleanSchema_false__emptyArrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + false + """, + false, + """boolean schema 'false' -> empty array is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const validation -> same value is valid" + */ + @Test + fun const_constValidation_sameValueIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constValidation_sameValueIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 2 + """, + """ + {"const":2} + """, + true, + """const validation -> same value is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const validation -> another value is invalid" + */ + @Test + fun const_constValidation_anotherValueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constValidation_anotherValueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 5 + """, + """ + {"const":2} + """, + false, + """const validation -> another value is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const validation -> another type is invalid" + */ + @Test + fun const_constValidation_anotherTypeIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constValidation_anotherTypeIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"const":2} + """, + false, + """const validation -> another type is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with object -> same object is valid" + */ + @Test + fun const_constWithObject_sameObjectIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithObject_sameObjectIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar","baz":"bax"} + """, + """ + {"const":{"foo":"bar","baz":"bax"}} + """, + true, + """const with object -> same object is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with object -> same object with different property order is valid" + */ + @Test + fun const_constWithObject_sameObjectWithDifferentPropertyOrderIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithObject_sameObjectWithDifferentPropertyOrderIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"baz":"bax","foo":"bar"} + """, + """ + {"const":{"foo":"bar","baz":"bax"}} + """, + true, + """const with object -> same object with different property order is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with object -> another object is invalid" + */ + @Test + fun const_constWithObject_anotherObjectIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithObject_anotherObjectIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"const":{"foo":"bar","baz":"bax"}} + """, + false, + """const with object -> another object is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with object -> another type is invalid" + */ + @Test + fun const_constWithObject_anotherTypeIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithObject_anotherTypeIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2] + """, + """ + {"const":{"foo":"bar","baz":"bax"}} + """, + false, + """const with object -> another type is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with array -> same array is valid" + */ + @Test + fun const_constWithArray_sameArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithArray_sameArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"foo":"bar"}] + """, + """ + {"const":[{"foo":"bar"}]} + """, + true, + """const with array -> same array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with array -> another array item is invalid" + */ + @Test + fun const_constWithArray_anotherArrayItemIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithArray_anotherArrayItemIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [2] + """, + """ + {"const":[{"foo":"bar"}]} + """, + false, + """const with array -> another array item is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with array -> array with additional items is invalid" + */ + @Test + fun const_constWithArray_arrayWithAdditionalItemsIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithArray_arrayWithAdditionalItemsIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3] + """, + """ + {"const":[{"foo":"bar"}]} + """, + false, + """const with array -> array with additional items is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with null -> null is valid" + */ + @Test + fun const_constWithNull_nullIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithNull_nullIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"const":null} + """, + true, + """const with null -> null is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with null -> not null is invalid" + */ + @Test + fun const_constWithNull_notNullIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithNull_notNullIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0 + """, + """ + {"const":null} + """, + false, + """const with null -> not null is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with false does not match 0 -> false is valid" + */ + @Test + fun const_constWithFalseDoesNotMatch0_falseIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithFalseDoesNotMatch0_falseIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"const":false} + """, + true, + """const with false does not match 0 -> false is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with false does not match 0 -> integer zero is invalid" + */ + @Test + fun const_constWithFalseDoesNotMatch0_integerZeroIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithFalseDoesNotMatch0_integerZeroIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0 + """, + """ + {"const":false} + """, + false, + """const with false does not match 0 -> integer zero is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with false does not match 0 -> float zero is invalid" + */ + @Test + fun const_constWithFalseDoesNotMatch0_floatZeroIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithFalseDoesNotMatch0_floatZeroIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0.0 + """, + """ + {"const":false} + """, + false, + """const with false does not match 0 -> float zero is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with true does not match 1 -> true is valid" + */ + @Test + fun const_constWithTrueDoesNotMatch1_trueIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithTrueDoesNotMatch1_trueIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"const":true} + """, + true, + """const with true does not match 1 -> true is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with true does not match 1 -> integer one is invalid" + */ + @Test + fun const_constWithTrueDoesNotMatch1_integerOneIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithTrueDoesNotMatch1_integerOneIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"const":true} + """, + false, + """const with true does not match 1 -> integer one is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with true does not match 1 -> float one is invalid" + */ + @Test + fun const_constWithTrueDoesNotMatch1_floatOneIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWithTrueDoesNotMatch1_floatOneIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.0 + """, + """ + {"const":true} + """, + false, + """const with true does not match 1 -> float one is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with [false] does not match [0] -> [false] is valid" + */ + @Test + fun const_constWith_false_DoesNotMatch_0___false_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith_false_DoesNotMatch_0___false_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false] + """, + """ + {"const":[false]} + """, + true, + """const with [false] does not match [0] -> [false] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with [false] does not match [0] -> [0] is invalid" + */ + @Test + fun const_constWith_false_DoesNotMatch_0___0_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith_false_DoesNotMatch_0___0_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [0] + """, + """ + {"const":[false]} + """, + false, + """const with [false] does not match [0] -> [0] is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with [false] does not match [0] -> [0.0] is invalid" + */ + @Test + fun const_constWith_false_DoesNotMatch_0___0_0_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith_false_DoesNotMatch_0___0_0_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [0.0] + """, + """ + {"const":[false]} + """, + false, + """const with [false] does not match [0] -> [0.0] is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with [true] does not match [1] -> [true] is valid" + */ + @Test + fun const_constWith_true_DoesNotMatch_1___true_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith_true_DoesNotMatch_1___true_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true] + """, + """ + {"const":[true]} + """, + true, + """const with [true] does not match [1] -> [true] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with [true] does not match [1] -> [1] is invalid" + */ + @Test + fun const_constWith_true_DoesNotMatch_1___1_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith_true_DoesNotMatch_1___1_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1] + """, + """ + {"const":[true]} + """, + false, + """const with [true] does not match [1] -> [1] is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with [true] does not match [1] -> [1.0] is invalid" + */ + @Test + fun const_constWith_true_DoesNotMatch_1___1_0_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith_true_DoesNotMatch_1___1_0_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1.0] + """, + """ + {"const":[true]} + """, + false, + """const with [true] does not match [1] -> [1.0] is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with {"a": false} does not match {"a": 0} -> {"a": false} is valid" + */ + @Test + fun const_constWith__a__False_DoesNotMatch__a__0____a__False_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith__a__False_DoesNotMatch__a__0____a__False_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a":false} + """, + """ + {"const":{"a":false}} + """, + true, + """const with {"a": false} does not match {"a": 0} -> {"a": false} is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with {"a": false} does not match {"a": 0} -> {"a": 0} is invalid" + */ + @Test + fun const_constWith__a__False_DoesNotMatch__a__0____a__0_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith__a__False_DoesNotMatch__a__0____a__0_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a":0} + """, + """ + {"const":{"a":false}} + """, + false, + """const with {"a": false} does not match {"a": 0} -> {"a": 0} is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with {"a": false} does not match {"a": 0} -> {"a": 0.0} is invalid" + */ + @Test + fun const_constWith__a__False_DoesNotMatch__a__0____a__0_0_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith__a__False_DoesNotMatch__a__0____a__0_0_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a":0.0} + """, + """ + {"const":{"a":false}} + """, + false, + """const with {"a": false} does not match {"a": 0} -> {"a": 0.0} is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with {"a": true} does not match {"a": 1} -> {"a": true} is valid" + */ + @Test + fun const_constWith__a__True_DoesNotMatch__a__1____a__True_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith__a__True_DoesNotMatch__a__1____a__True_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a":true} + """, + """ + {"const":{"a":true}} + """, + true, + """const with {"a": true} does not match {"a": 1} -> {"a": true} is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with {"a": true} does not match {"a": 1} -> {"a": 1} is invalid" + */ + @Test + fun const_constWith__a__True_DoesNotMatch__a__1____a__1_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith__a__True_DoesNotMatch__a__1____a__1_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a":1} + """, + """ + {"const":{"a":true}} + """, + false, + """const with {"a": true} does not match {"a": 1} -> {"a": 1} is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with {"a": true} does not match {"a": 1} -> {"a": 1.0} is invalid" + */ + @Test + fun const_constWith__a__True_DoesNotMatch__a__1____a__1_0_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith__a__True_DoesNotMatch__a__1____a__1_0_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a":1.0} + """, + """ + {"const":{"a":true}} + """, + false, + """const with {"a": true} does not match {"a": 1} -> {"a": 1.0} is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with 0 does not match other zero-like types -> false is invalid" + */ + @Test + fun const_constWith0DoesNotMatchOtherZero_likeTypes_falseIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith0DoesNotMatchOtherZero_likeTypes_falseIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"const":0} + """, + false, + """const with 0 does not match other zero-like types -> false is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with 0 does not match other zero-like types -> integer zero is valid" + */ + @Test + fun const_constWith0DoesNotMatchOtherZero_likeTypes_integerZeroIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith0DoesNotMatchOtherZero_likeTypes_integerZeroIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0 + """, + """ + {"const":0} + """, + true, + """const with 0 does not match other zero-like types -> integer zero is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with 0 does not match other zero-like types -> float zero is valid" + */ + @Test + fun const_constWith0DoesNotMatchOtherZero_likeTypes_floatZeroIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith0DoesNotMatchOtherZero_likeTypes_floatZeroIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0.0 + """, + """ + {"const":0} + """, + true, + """const with 0 does not match other zero-like types -> float zero is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with 0 does not match other zero-like types -> empty object is invalid" + */ + @Test + fun const_constWith0DoesNotMatchOtherZero_likeTypes_emptyObjectIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith0DoesNotMatchOtherZero_likeTypes_emptyObjectIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"const":0} + """, + false, + """const with 0 does not match other zero-like types -> empty object is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with 0 does not match other zero-like types -> empty array is invalid" + */ + @Test + fun const_constWith0DoesNotMatchOtherZero_likeTypes_emptyArrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith0DoesNotMatchOtherZero_likeTypes_emptyArrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"const":0} + """, + false, + """const with 0 does not match other zero-like types -> empty array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with 0 does not match other zero-like types -> empty string is invalid" + */ + @Test + fun const_constWith0DoesNotMatchOtherZero_likeTypes_emptyStringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith0DoesNotMatchOtherZero_likeTypes_emptyStringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "" + """, + """ + {"const":0} + """, + false, + """const with 0 does not match other zero-like types -> empty string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with 1 does not match true -> true is invalid" + */ + @Test + fun const_constWith1DoesNotMatchTrue_trueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith1DoesNotMatchTrue_trueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"const":1} + """, + false, + """const with 1 does not match true -> true is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with 1 does not match true -> integer one is valid" + */ + @Test + fun const_constWith1DoesNotMatchTrue_integerOneIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith1DoesNotMatchTrue_integerOneIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"const":1} + """, + true, + """const with 1 does not match true -> integer one is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with 1 does not match true -> float one is valid" + */ + @Test + fun const_constWith1DoesNotMatchTrue_floatOneIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith1DoesNotMatchTrue_floatOneIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.0 + """, + """ + {"const":1} + """, + true, + """const with 1 does not match true -> float one is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with -2.0 matches integer and float types -> integer -2 is valid" + */ + @Test + fun const_constWith_2_0MatchesIntegerAndFloatTypes_integer_2IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith_2_0MatchesIntegerAndFloatTypes_integer_2IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -2 + """, + """ + {"const":-2.0} + """, + true, + """const with -2.0 matches integer and float types -> integer -2 is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with -2.0 matches integer and float types -> integer 2 is invalid" + */ + @Test + fun const_constWith_2_0MatchesIntegerAndFloatTypes_integer2IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith_2_0MatchesIntegerAndFloatTypes_integer2IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 2 + """, + """ + {"const":-2.0} + """, + false, + """const with -2.0 matches integer and float types -> integer 2 is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with -2.0 matches integer and float types -> float -2.0 is valid" + */ + @Test + fun const_constWith_2_0MatchesIntegerAndFloatTypes_float_2_0IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith_2_0MatchesIntegerAndFloatTypes_float_2_0IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -2.0 + """, + """ + {"const":-2.0} + """, + true, + """const with -2.0 matches integer and float types -> float -2.0 is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with -2.0 matches integer and float types -> float 2.0 is invalid" + */ + @Test + fun const_constWith_2_0MatchesIntegerAndFloatTypes_float2_0IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith_2_0MatchesIntegerAndFloatTypes_float2_0IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 2.0 + """, + """ + {"const":-2.0} + """, + false, + """const with -2.0 matches integer and float types -> float 2.0 is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "const with -2.0 matches integer and float types -> float -2.00001 is invalid" + */ + @Test + fun const_constWith_2_0MatchesIntegerAndFloatTypes_float_2_00001IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_constWith_2_0MatchesIntegerAndFloatTypes_float_2_00001IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -2.00001 + """, + """ + {"const":-2.0} + """, + false, + """const with -2.0 matches integer and float types -> float -2.00001 is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "float and integers are equal up to 64-bit representation limits -> integer is valid" + */ + @Test + fun const_floatAndIntegersAreEqualUpTo64_bitRepresentationLimits_integerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_floatAndIntegersAreEqualUpTo64_bitRepresentationLimits_integerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 9007199254740992 + """, + """ + {"const":9007199254740992} + """, + true, + """float and integers are equal up to 64-bit representation limits -> integer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "float and integers are equal up to 64-bit representation limits -> integer minus one is invalid" + */ + @Test + fun const_floatAndIntegersAreEqualUpTo64_bitRepresentationLimits_integerMinusOneIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_floatAndIntegersAreEqualUpTo64_bitRepresentationLimits_integerMinusOneIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 9007199254740991 + """, + """ + {"const":9007199254740992} + """, + false, + """float and integers are equal up to 64-bit representation limits -> integer minus one is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "float and integers are equal up to 64-bit representation limits -> float is valid" + */ + @Test + fun const_floatAndIntegersAreEqualUpTo64_bitRepresentationLimits_floatIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_floatAndIntegersAreEqualUpTo64_bitRepresentationLimits_floatIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 9007199254740992.0 + """, + """ + {"const":9007199254740992} + """, + true, + """float and integers are equal up to 64-bit representation limits -> float is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "float and integers are equal up to 64-bit representation limits -> float minus one is invalid" + */ + @Test + fun const_floatAndIntegersAreEqualUpTo64_bitRepresentationLimits_floatMinusOneIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_floatAndIntegersAreEqualUpTo64_bitRepresentationLimits_floatMinusOneIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 9007199254740991.0 + """, + """ + {"const":9007199254740992} + """, + false, + """float and integers are equal up to 64-bit representation limits -> float minus one is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "nul characters in strings -> match string with nul" + */ + @Test + fun const_nulCharactersInStrings_matchStringWithNul() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_nulCharactersInStrings_matchStringWithNul" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "hello\u0000there" + """, + """ + {"const":"hello\u0000there"} + """, + true, + """nul characters in strings -> match string with nul""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/const.json`: + * "nul characters in strings -> do not match string lacking nul" + */ + @Test + fun const_nulCharactersInStrings_doNotMatchStringLackingNul() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "const_nulCharactersInStrings_doNotMatchStringLackingNul" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "hellothere" + """, + """ + {"const":"hello\u0000there"} + """, + false, + """nul characters in strings -> do not match string lacking nul""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword validation -> array with item matching schema (5) is valid" + */ + @Test + fun contains_containsKeywordValidation_arrayWithItemMatchingSchema_5_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordValidation_arrayWithItemMatchingSchema_5_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [3,4,5] + """, + """ + {"contains":{"minimum":5}} + """, + true, + """contains keyword validation -> array with item matching schema (5) is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword validation -> array with item matching schema (6) is valid" + */ + @Test + fun contains_containsKeywordValidation_arrayWithItemMatchingSchema_6_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordValidation_arrayWithItemMatchingSchema_6_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [3,4,6] + """, + """ + {"contains":{"minimum":5}} + """, + true, + """contains keyword validation -> array with item matching schema (6) is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword validation -> array with two items matching schema (5, 6) is valid" + */ + @Test + fun contains_containsKeywordValidation_arrayWithTwoItemsMatchingSchema_5_6_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordValidation_arrayWithTwoItemsMatchingSchema_5_6_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [3,4,5,6] + """, + """ + {"contains":{"minimum":5}} + """, + true, + """contains keyword validation -> array with two items matching schema (5, 6) is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword validation -> array without items matching schema is invalid" + */ + @Test + fun contains_containsKeywordValidation_arrayWithoutItemsMatchingSchemaIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordValidation_arrayWithoutItemsMatchingSchemaIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [2,3,4] + """, + """ + {"contains":{"minimum":5}} + """, + false, + """contains keyword validation -> array without items matching schema is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword validation -> empty array is invalid" + */ + @Test + fun contains_containsKeywordValidation_emptyArrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordValidation_emptyArrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"contains":{"minimum":5}} + """, + false, + """contains keyword validation -> empty array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword validation -> not array is valid" + */ + @Test + fun contains_containsKeywordValidation_notArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordValidation_notArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"contains":{"minimum":5}} + """, + true, + """contains keyword validation -> not array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword with const keyword -> array with item 5 is valid" + */ + @Test + fun contains_containsKeywordWithConstKeyword_arrayWithItem5IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordWithConstKeyword_arrayWithItem5IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [3,4,5] + """, + """ + {"contains":{"const":5}} + """, + true, + """contains keyword with const keyword -> array with item 5 is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword with const keyword -> array with two items 5 is valid" + */ + @Test + fun contains_containsKeywordWithConstKeyword_arrayWithTwoItems5IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordWithConstKeyword_arrayWithTwoItems5IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [3,4,5,5] + """, + """ + {"contains":{"const":5}} + """, + true, + """contains keyword with const keyword -> array with two items 5 is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword with const keyword -> array without item 5 is invalid" + */ + @Test + fun contains_containsKeywordWithConstKeyword_arrayWithoutItem5IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordWithConstKeyword_arrayWithoutItem5IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3,4] + """, + """ + {"contains":{"const":5}} + """, + false, + """contains keyword with const keyword -> array without item 5 is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword with boolean schema true -> any non-empty array is valid" + */ + @Test + fun contains_containsKeywordWithBooleanSchemaTrue_anyNon_emptyArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordWithBooleanSchemaTrue_anyNon_emptyArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["foo"] + """, + """ + {"contains":true} + """, + true, + """contains keyword with boolean schema true -> any non-empty array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword with boolean schema true -> empty array is invalid" + */ + @Test + fun contains_containsKeywordWithBooleanSchemaTrue_emptyArrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordWithBooleanSchemaTrue_emptyArrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"contains":true} + """, + false, + """contains keyword with boolean schema true -> empty array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword with boolean schema false -> any non-empty array is invalid" + */ + @Test + fun contains_containsKeywordWithBooleanSchemaFalse_anyNon_emptyArrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordWithBooleanSchemaFalse_anyNon_emptyArrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["foo"] + """, + """ + {"contains":false} + """, + false, + """contains keyword with boolean schema false -> any non-empty array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword with boolean schema false -> empty array is invalid" + */ + @Test + fun contains_containsKeywordWithBooleanSchemaFalse_emptyArrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordWithBooleanSchemaFalse_emptyArrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"contains":false} + """, + false, + """contains keyword with boolean schema false -> empty array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains keyword with boolean schema false -> non-arrays are valid" + */ + @Test + fun contains_containsKeywordWithBooleanSchemaFalse_non_arraysAreValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsKeywordWithBooleanSchemaFalse_non_arraysAreValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "contains does not apply to strings" + """, + """ + {"contains":false} + """, + true, + """contains keyword with boolean schema false -> non-arrays are valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "items + contains -> matches items, does not match contains" + */ + @Test + fun contains_items_Contains_matchesItems_DoesNotMatchContains() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_items_Contains_matchesItems_DoesNotMatchContains" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [2,4,8] + """, + """ + {"items":{"multipleOf":2},"contains":{"multipleOf":3}} + """, + false, + """items + contains -> matches items, does not match contains""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "items + contains -> does not match items, matches contains" + */ + @Test + fun contains_items_Contains_doesNotMatchItems_MatchesContains() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_items_Contains_doesNotMatchItems_MatchesContains" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [3,6,9] + """, + """ + {"items":{"multipleOf":2},"contains":{"multipleOf":3}} + """, + false, + """items + contains -> does not match items, matches contains""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "items + contains -> matches both items and contains" + */ + @Test + fun contains_items_Contains_matchesBothItemsAndContains() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_items_Contains_matchesBothItemsAndContains" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [6,12] + """, + """ + {"items":{"multipleOf":2},"contains":{"multipleOf":3}} + """, + true, + """items + contains -> matches both items and contains""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "items + contains -> matches neither items nor contains" + */ + @Test + fun contains_items_Contains_matchesNeitherItemsNorContains() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_items_Contains_matchesNeitherItemsNorContains" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,5] + """, + """ + {"items":{"multipleOf":2},"contains":{"multipleOf":3}} + """, + false, + """items + contains -> matches neither items nor contains""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains with false if subschema -> any non-empty array is valid" + */ + @Test + fun contains_containsWithFalseIfSubschema_anyNon_emptyArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsWithFalseIfSubschema_anyNon_emptyArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["foo"] + """, + """ + {"contains":{"if":false,"else":true}} + """, + true, + """contains with false if subschema -> any non-empty array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains with false if subschema -> empty array is invalid" + */ + @Test + fun contains_containsWithFalseIfSubschema_emptyArrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsWithFalseIfSubschema_emptyArrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"contains":{"if":false,"else":true}} + """, + false, + """contains with false if subschema -> empty array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/contains.json`: + * "contains with null instance elements -> allows null items" + */ + @Test + fun contains_containsWithNullInstanceElements_allowsNullItems() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "contains_containsWithNullInstanceElements_allowsNullItems" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [null] + """, + """ + {"contains":{"type":"null"}} + """, + true, + """contains with null instance elements -> allows null items""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/default.json`: + * "invalid type for default -> valid when property is specified" + */ + @Test + fun default_invalidTypeForDefault_validWhenPropertyIsSpecified() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "default_invalidTypeForDefault_validWhenPropertyIsSpecified" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":13} + """, + """ + {"properties":{"foo":{"type":"integer","default":[]}}} + """, + true, + """invalid type for default -> valid when property is specified""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/default.json`: + * "invalid type for default -> still valid when the invalid default is used" + */ + @Test + fun default_invalidTypeForDefault_stillValidWhenTheInvalidDefaultIsUsed() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "default_invalidTypeForDefault_stillValidWhenTheInvalidDefaultIsUsed" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"properties":{"foo":{"type":"integer","default":[]}}} + """, + true, + """invalid type for default -> still valid when the invalid default is used""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/default.json`: + * "invalid string value for default -> valid when property is specified" + */ + @Test + fun default_invalidStringValueForDefault_validWhenPropertyIsSpecified() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "default_invalidStringValueForDefault_validWhenPropertyIsSpecified" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":"good"} + """, + """ + {"properties":{"bar":{"type":"string","minLength":4,"default":"bad"}}} + """, + true, + """invalid string value for default -> valid when property is specified""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/default.json`: + * "invalid string value for default -> still valid when the invalid default is used" + */ + @Test + fun default_invalidStringValueForDefault_stillValidWhenTheInvalidDefaultIsUsed() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "default_invalidStringValueForDefault_stillValidWhenTheInvalidDefaultIsUsed" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"properties":{"bar":{"type":"string","minLength":4,"default":"bad"}}} + """, + true, + """invalid string value for default -> still valid when the invalid default is used""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/default.json`: + * "the default keyword does not do anything if the property is missing -> an explicit property value is checked against maximum (passing)" + */ + @Test + fun default_theDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing_anExplicitPropertyValueIsCheckedAgainstMaximum_passing_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "default_theDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing_anExplicitPropertyValueIsCheckedAgainstMaximum_passing_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"alpha":1} + """, + """ + {"type":"object","properties":{"alpha":{"type":"number","maximum":3,"default":5}}} + """, + true, + """the default keyword does not do anything if the property is missing -> an explicit property value is checked against maximum (passing)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/default.json`: + * "the default keyword does not do anything if the property is missing -> an explicit property value is checked against maximum (failing)" + */ + @Test + fun default_theDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing_anExplicitPropertyValueIsCheckedAgainstMaximum_failing_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "default_theDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing_anExplicitPropertyValueIsCheckedAgainstMaximum_failing_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"alpha":5} + """, + """ + {"type":"object","properties":{"alpha":{"type":"number","maximum":3,"default":5}}} + """, + false, + """the default keyword does not do anything if the property is missing -> an explicit property value is checked against maximum (failing)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/default.json`: + * "the default keyword does not do anything if the property is missing -> missing properties are not filled in with the default" + */ + @Test + fun default_theDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing_missingPropertiesAreNotFilledInWithTheDefault() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "default_theDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing_missingPropertiesAreNotFilledInWithTheDefault" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"type":"object","properties":{"alpha":{"type":"number","maximum":3,"default":5}}} + """, + true, + """the default keyword does not do anything if the property is missing -> missing properties are not filled in with the default""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/definitions.json`: + * "validate definition against metaschema -> valid definition schema" + */ + @Test + fun definitions_validateDefinitionAgainstMetaschema_validDefinitionSchema() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "definitions_validateDefinitionAgainstMetaschema_validDefinitionSchema" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"definitions":{"foo":{"type":"integer"}}} + """, + """ + {"${'$'}ref":"http://json-schema.org/draft-07/schema#"} + """, + true, + """validate definition against metaschema -> valid definition schema""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/definitions.json`: + * "validate definition against metaschema -> invalid definition schema" + */ + @Test + fun definitions_validateDefinitionAgainstMetaschema_invalidDefinitionSchema() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "definitions_validateDefinitionAgainstMetaschema_invalidDefinitionSchema" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"definitions":{"foo":{"type":1}}} + """, + """ + {"${'$'}ref":"http://json-schema.org/draft-07/schema#"} + """, + false, + """validate definition against metaschema -> invalid definition schema""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies -> neither" + */ + @Test + fun dependencies_dependencies_neither() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependencies_neither" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"dependencies":{"bar":["foo"]}} + """, + true, + """dependencies -> neither""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies -> nondependant" + */ + @Test + fun dependencies_dependencies_nondependant() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependencies_nondependant" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"dependencies":{"bar":["foo"]}} + """, + true, + """dependencies -> nondependant""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies -> with dependency" + */ + @Test + fun dependencies_dependencies_withDependency() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependencies_withDependency" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2} + """, + """ + {"dependencies":{"bar":["foo"]}} + """, + true, + """dependencies -> with dependency""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies -> missing dependency" + */ + @Test + fun dependencies_dependencies_missingDependency() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependencies_missingDependency" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":2} + """, + """ + {"dependencies":{"bar":["foo"]}} + """, + false, + """dependencies -> missing dependency""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies -> ignores arrays" + */ + @Test + fun dependencies_dependencies_ignoresArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependencies_ignoresArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["bar"] + """, + """ + {"dependencies":{"bar":["foo"]}} + """, + true, + """dependencies -> ignores arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies -> ignores strings" + */ + @Test + fun dependencies_dependencies_ignoresStrings() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependencies_ignoresStrings" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foobar" + """, + """ + {"dependencies":{"bar":["foo"]}} + """, + true, + """dependencies -> ignores strings""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies -> ignores other non-objects" + */ + @Test + fun dependencies_dependencies_ignoresOtherNon_objects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependencies_ignoresOtherNon_objects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"dependencies":{"bar":["foo"]}} + """, + true, + """dependencies -> ignores other non-objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with empty array -> empty object" + */ + @Test + fun dependencies_dependenciesWithEmptyArray_emptyObject() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithEmptyArray_emptyObject" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"dependencies":{"bar":[]}} + """, + true, + """dependencies with empty array -> empty object""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with empty array -> object with one property" + */ + @Test + fun dependencies_dependenciesWithEmptyArray_objectWithOneProperty() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithEmptyArray_objectWithOneProperty" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":2} + """, + """ + {"dependencies":{"bar":[]}} + """, + true, + """dependencies with empty array -> object with one property""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with empty array -> non-object is valid" + */ + @Test + fun dependencies_dependenciesWithEmptyArray_non_objectIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithEmptyArray_non_objectIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"dependencies":{"bar":[]}} + """, + true, + """dependencies with empty array -> non-object is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "multiple dependencies -> neither" + */ + @Test + fun dependencies_multipleDependencies_neither() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_multipleDependencies_neither" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"dependencies":{"quux":["foo","bar"]}} + """, + true, + """multiple dependencies -> neither""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "multiple dependencies -> nondependants" + */ + @Test + fun dependencies_multipleDependencies_nondependants() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_multipleDependencies_nondependants" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2} + """, + """ + {"dependencies":{"quux":["foo","bar"]}} + """, + true, + """multiple dependencies -> nondependants""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "multiple dependencies -> with dependencies" + */ + @Test + fun dependencies_multipleDependencies_withDependencies() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_multipleDependencies_withDependencies" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2,"quux":3} + """, + """ + {"dependencies":{"quux":["foo","bar"]}} + """, + true, + """multiple dependencies -> with dependencies""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "multiple dependencies -> missing dependency" + */ + @Test + fun dependencies_multipleDependencies_missingDependency() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_multipleDependencies_missingDependency" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"quux":2} + """, + """ + {"dependencies":{"quux":["foo","bar"]}} + """, + false, + """multiple dependencies -> missing dependency""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "multiple dependencies -> missing other dependency" + */ + @Test + fun dependencies_multipleDependencies_missingOtherDependency() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_multipleDependencies_missingOtherDependency" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":1,"quux":2} + """, + """ + {"dependencies":{"quux":["foo","bar"]}} + """, + false, + """multiple dependencies -> missing other dependency""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "multiple dependencies -> missing both dependencies" + */ + @Test + fun dependencies_multipleDependencies_missingBothDependencies() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_multipleDependencies_missingBothDependencies" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"quux":1} + """, + """ + {"dependencies":{"quux":["foo","bar"]}} + """, + false, + """multiple dependencies -> missing both dependencies""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "multiple dependencies subschema -> valid" + */ + @Test + fun dependencies_multipleDependenciesSubschema_valid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_multipleDependenciesSubschema_valid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2} + """, + """ + {"dependencies":{"bar":{"properties":{"foo":{"type":"integer"},"bar":{"type":"integer"}}}}} + """, + true, + """multiple dependencies subschema -> valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "multiple dependencies subschema -> no dependency" + */ + @Test + fun dependencies_multipleDependenciesSubschema_noDependency() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_multipleDependenciesSubschema_noDependency" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"quux"} + """, + """ + {"dependencies":{"bar":{"properties":{"foo":{"type":"integer"},"bar":{"type":"integer"}}}}} + """, + true, + """multiple dependencies subschema -> no dependency""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "multiple dependencies subschema -> wrong type" + */ + @Test + fun dependencies_multipleDependenciesSubschema_wrongType() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_multipleDependenciesSubschema_wrongType" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"quux","bar":2} + """, + """ + {"dependencies":{"bar":{"properties":{"foo":{"type":"integer"},"bar":{"type":"integer"}}}}} + """, + false, + """multiple dependencies subschema -> wrong type""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "multiple dependencies subschema -> wrong type other" + */ + @Test + fun dependencies_multipleDependenciesSubschema_wrongTypeOther() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_multipleDependenciesSubschema_wrongTypeOther" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":2,"bar":"quux"} + """, + """ + {"dependencies":{"bar":{"properties":{"foo":{"type":"integer"},"bar":{"type":"integer"}}}}} + """, + false, + """multiple dependencies subschema -> wrong type other""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "multiple dependencies subschema -> wrong type both" + */ + @Test + fun dependencies_multipleDependenciesSubschema_wrongTypeBoth() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_multipleDependenciesSubschema_wrongTypeBoth" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"quux","bar":"quux"} + """, + """ + {"dependencies":{"bar":{"properties":{"foo":{"type":"integer"},"bar":{"type":"integer"}}}}} + """, + false, + """multiple dependencies subschema -> wrong type both""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with boolean subschemas -> object with property having schema true is valid" + */ + @Test + fun dependencies_dependenciesWithBooleanSubschemas_objectWithPropertyHavingSchemaTrueIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithBooleanSubschemas_objectWithPropertyHavingSchemaTrueIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"dependencies":{"foo":true,"bar":false}} + """, + true, + """dependencies with boolean subschemas -> object with property having schema true is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with boolean subschemas -> object with property having schema false is invalid" + */ + @Test + fun dependencies_dependenciesWithBooleanSubschemas_objectWithPropertyHavingSchemaFalseIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithBooleanSubschemas_objectWithPropertyHavingSchemaFalseIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":2} + """, + """ + {"dependencies":{"foo":true,"bar":false}} + """, + false, + """dependencies with boolean subschemas -> object with property having schema false is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with boolean subschemas -> object with both properties is invalid" + */ + @Test + fun dependencies_dependenciesWithBooleanSubschemas_objectWithBothPropertiesIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithBooleanSubschemas_objectWithBothPropertiesIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2} + """, + """ + {"dependencies":{"foo":true,"bar":false}} + """, + false, + """dependencies with boolean subschemas -> object with both properties is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with boolean subschemas -> empty object is valid" + */ + @Test + fun dependencies_dependenciesWithBooleanSubschemas_emptyObjectIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithBooleanSubschemas_emptyObjectIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"dependencies":{"foo":true,"bar":false}} + """, + true, + """dependencies with boolean subschemas -> empty object is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with escaped characters -> valid object 1" + */ + @Test + fun dependencies_dependenciesWithEscapedCharacters_validObject1() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithEscapedCharacters_validObject1" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo\nbar":1,"foo\rbar":2} + """, + """ + {"dependencies":{"foo\nbar":["foo\rbar"],"foo\tbar":{"minProperties":4},"foo'bar":{"required":["foo\"bar"]},"foo\"bar":["foo'bar"]}} + """, + true, + """dependencies with escaped characters -> valid object 1""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with escaped characters -> valid object 2" + */ + @Test + fun dependencies_dependenciesWithEscapedCharacters_validObject2() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithEscapedCharacters_validObject2" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo\tbar":1,"a":2,"b":3,"c":4} + """, + """ + {"dependencies":{"foo\nbar":["foo\rbar"],"foo\tbar":{"minProperties":4},"foo'bar":{"required":["foo\"bar"]},"foo\"bar":["foo'bar"]}} + """, + true, + """dependencies with escaped characters -> valid object 2""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with escaped characters -> valid object 3" + */ + @Test + fun dependencies_dependenciesWithEscapedCharacters_validObject3() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithEscapedCharacters_validObject3" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo'bar":1,"foo\"bar":2} + """, + """ + {"dependencies":{"foo\nbar":["foo\rbar"],"foo\tbar":{"minProperties":4},"foo'bar":{"required":["foo\"bar"]},"foo\"bar":["foo'bar"]}} + """, + true, + """dependencies with escaped characters -> valid object 3""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with escaped characters -> invalid object 1" + */ + @Test + fun dependencies_dependenciesWithEscapedCharacters_invalidObject1() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithEscapedCharacters_invalidObject1" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo\nbar":1,"foo":2} + """, + """ + {"dependencies":{"foo\nbar":["foo\rbar"],"foo\tbar":{"minProperties":4},"foo'bar":{"required":["foo\"bar"]},"foo\"bar":["foo'bar"]}} + """, + false, + """dependencies with escaped characters -> invalid object 1""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with escaped characters -> invalid object 2" + */ + @Test + fun dependencies_dependenciesWithEscapedCharacters_invalidObject2() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithEscapedCharacters_invalidObject2" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo\tbar":1,"a":2} + """, + """ + {"dependencies":{"foo\nbar":["foo\rbar"],"foo\tbar":{"minProperties":4},"foo'bar":{"required":["foo\"bar"]},"foo\"bar":["foo'bar"]}} + """, + false, + """dependencies with escaped characters -> invalid object 2""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with escaped characters -> invalid object 3" + */ + @Test + fun dependencies_dependenciesWithEscapedCharacters_invalidObject3() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithEscapedCharacters_invalidObject3" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo'bar":1} + """, + """ + {"dependencies":{"foo\nbar":["foo\rbar"],"foo\tbar":{"minProperties":4},"foo'bar":{"required":["foo\"bar"]},"foo\"bar":["foo'bar"]}} + """, + false, + """dependencies with escaped characters -> invalid object 3""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependencies with escaped characters -> invalid object 4" + */ + @Test + fun dependencies_dependenciesWithEscapedCharacters_invalidObject4() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependenciesWithEscapedCharacters_invalidObject4" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo\"bar":2} + """, + """ + {"dependencies":{"foo\nbar":["foo\rbar"],"foo\tbar":{"minProperties":4},"foo'bar":{"required":["foo\"bar"]},"foo\"bar":["foo'bar"]}} + """, + false, + """dependencies with escaped characters -> invalid object 4""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependent subschema incompatible with root -> matches root" + */ + @Test + fun dependencies_dependentSubschemaIncompatibleWithRoot_matchesRoot() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependentSubschemaIncompatibleWithRoot_matchesRoot" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"properties":{"foo":{}},"dependencies":{"foo":{"properties":{"bar":{}},"additionalProperties":false}}} + """, + false, + """dependent subschema incompatible with root -> matches root""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependent subschema incompatible with root -> matches dependency" + */ + @Test + fun dependencies_dependentSubschemaIncompatibleWithRoot_matchesDependency() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependentSubschemaIncompatibleWithRoot_matchesDependency" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":1} + """, + """ + {"properties":{"foo":{}},"dependencies":{"foo":{"properties":{"bar":{}},"additionalProperties":false}}} + """, + true, + """dependent subschema incompatible with root -> matches dependency""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependent subschema incompatible with root -> matches both" + */ + @Test + fun dependencies_dependentSubschemaIncompatibleWithRoot_matchesBoth() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependentSubschemaIncompatibleWithRoot_matchesBoth" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2} + """, + """ + {"properties":{"foo":{}},"dependencies":{"foo":{"properties":{"bar":{}},"additionalProperties":false}}} + """, + false, + """dependent subschema incompatible with root -> matches both""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/dependencies.json`: + * "dependent subschema incompatible with root -> no dependency" + */ + @Test + fun dependencies_dependentSubschemaIncompatibleWithRoot_noDependency() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "dependencies_dependentSubschemaIncompatibleWithRoot_noDependency" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"baz":1} + """, + """ + {"properties":{"foo":{}},"dependencies":{"foo":{"properties":{"bar":{}},"additionalProperties":false}}} + """, + true, + """dependent subschema incompatible with root -> no dependency""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "simple enum validation -> one of the enum is valid" + */ + @Test + fun enum_simpleEnumValidation_oneOfTheEnumIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_simpleEnumValidation_oneOfTheEnumIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"enum":[1,2,3]} + """, + true, + """simple enum validation -> one of the enum is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "simple enum validation -> something else is invalid" + */ + @Test + fun enum_simpleEnumValidation_somethingElseIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_simpleEnumValidation_somethingElseIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 4 + """, + """ + {"enum":[1,2,3]} + """, + false, + """simple enum validation -> something else is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "heterogeneous enum validation -> one of the enum is valid" + */ + @Test + fun enum_heterogeneousEnumValidation_oneOfTheEnumIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_heterogeneousEnumValidation_oneOfTheEnumIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"enum":[6,"foo",[],true,{"foo":12}]} + """, + true, + """heterogeneous enum validation -> one of the enum is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "heterogeneous enum validation -> something else is invalid" + */ + @Test + fun enum_heterogeneousEnumValidation_somethingElseIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_heterogeneousEnumValidation_somethingElseIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"enum":[6,"foo",[],true,{"foo":12}]} + """, + false, + """heterogeneous enum validation -> something else is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "heterogeneous enum validation -> objects are deep compared" + */ + @Test + fun enum_heterogeneousEnumValidation_objectsAreDeepCompared() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_heterogeneousEnumValidation_objectsAreDeepCompared" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":false} + """, + """ + {"enum":[6,"foo",[],true,{"foo":12}]} + """, + false, + """heterogeneous enum validation -> objects are deep compared""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "heterogeneous enum validation -> valid object matches" + */ + @Test + fun enum_heterogeneousEnumValidation_validObjectMatches() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_heterogeneousEnumValidation_validObjectMatches" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":12} + """, + """ + {"enum":[6,"foo",[],true,{"foo":12}]} + """, + true, + """heterogeneous enum validation -> valid object matches""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "heterogeneous enum validation -> extra properties in object is invalid" + */ + @Test + fun enum_heterogeneousEnumValidation_extraPropertiesInObjectIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_heterogeneousEnumValidation_extraPropertiesInObjectIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":12,"boo":42} + """, + """ + {"enum":[6,"foo",[],true,{"foo":12}]} + """, + false, + """heterogeneous enum validation -> extra properties in object is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "heterogeneous enum-with-null validation -> null is valid" + */ + @Test + fun enum_heterogeneousEnum_with_nullValidation_nullIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_heterogeneousEnum_with_nullValidation_nullIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"enum":[6,null]} + """, + true, + """heterogeneous enum-with-null validation -> null is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "heterogeneous enum-with-null validation -> number is valid" + */ + @Test + fun enum_heterogeneousEnum_with_nullValidation_numberIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_heterogeneousEnum_with_nullValidation_numberIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 6 + """, + """ + {"enum":[6,null]} + """, + true, + """heterogeneous enum-with-null validation -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "heterogeneous enum-with-null validation -> something else is invalid" + */ + @Test + fun enum_heterogeneousEnum_with_nullValidation_somethingElseIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_heterogeneousEnum_with_nullValidation_somethingElseIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "test" + """, + """ + {"enum":[6,null]} + """, + false, + """heterogeneous enum-with-null validation -> something else is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enums in properties -> both properties are valid" + */ + @Test + fun enum_enumsInProperties_bothPropertiesAreValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumsInProperties_bothPropertiesAreValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"foo","bar":"bar"} + """, + """ + {"type":"object","properties":{"foo":{"enum":["foo"]},"bar":{"enum":["bar"]}},"required":["bar"]} + """, + true, + """enums in properties -> both properties are valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enums in properties -> wrong foo value" + */ + @Test + fun enum_enumsInProperties_wrongFooValue() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumsInProperties_wrongFooValue" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"foot","bar":"bar"} + """, + """ + {"type":"object","properties":{"foo":{"enum":["foo"]},"bar":{"enum":["bar"]}},"required":["bar"]} + """, + false, + """enums in properties -> wrong foo value""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enums in properties -> wrong bar value" + */ + @Test + fun enum_enumsInProperties_wrongBarValue() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumsInProperties_wrongBarValue" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"foo","bar":"bart"} + """, + """ + {"type":"object","properties":{"foo":{"enum":["foo"]},"bar":{"enum":["bar"]}},"required":["bar"]} + """, + false, + """enums in properties -> wrong bar value""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enums in properties -> missing optional property is valid" + */ + @Test + fun enum_enumsInProperties_missingOptionalPropertyIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumsInProperties_missingOptionalPropertyIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":"bar"} + """, + """ + {"type":"object","properties":{"foo":{"enum":["foo"]},"bar":{"enum":["bar"]}},"required":["bar"]} + """, + true, + """enums in properties -> missing optional property is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enums in properties -> missing required property is invalid" + */ + @Test + fun enum_enumsInProperties_missingRequiredPropertyIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumsInProperties_missingRequiredPropertyIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"foo"} + """, + """ + {"type":"object","properties":{"foo":{"enum":["foo"]},"bar":{"enum":["bar"]}},"required":["bar"]} + """, + false, + """enums in properties -> missing required property is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enums in properties -> missing all properties is invalid" + */ + @Test + fun enum_enumsInProperties_missingAllPropertiesIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumsInProperties_missingAllPropertiesIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"type":"object","properties":{"foo":{"enum":["foo"]},"bar":{"enum":["bar"]}},"required":["bar"]} + """, + false, + """enums in properties -> missing all properties is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with escaped characters -> member 1 is valid" + */ + @Test + fun enum_enumWithEscapedCharacters_member1IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWithEscapedCharacters_member1IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo\nbar" + """, + """ + {"enum":["foo\nbar","foo\rbar"]} + """, + true, + """enum with escaped characters -> member 1 is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with escaped characters -> member 2 is valid" + */ + @Test + fun enum_enumWithEscapedCharacters_member2IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWithEscapedCharacters_member2IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo\rbar" + """, + """ + {"enum":["foo\nbar","foo\rbar"]} + """, + true, + """enum with escaped characters -> member 2 is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with escaped characters -> another string is invalid" + */ + @Test + fun enum_enumWithEscapedCharacters_anotherStringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWithEscapedCharacters_anotherStringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "abc" + """, + """ + {"enum":["foo\nbar","foo\rbar"]} + """, + false, + """enum with escaped characters -> another string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with false does not match 0 -> false is valid" + */ + @Test + fun enum_enumWithFalseDoesNotMatch0_falseIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWithFalseDoesNotMatch0_falseIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"enum":[false]} + """, + true, + """enum with false does not match 0 -> false is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with false does not match 0 -> integer zero is invalid" + */ + @Test + fun enum_enumWithFalseDoesNotMatch0_integerZeroIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWithFalseDoesNotMatch0_integerZeroIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0 + """, + """ + {"enum":[false]} + """, + false, + """enum with false does not match 0 -> integer zero is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with false does not match 0 -> float zero is invalid" + */ + @Test + fun enum_enumWithFalseDoesNotMatch0_floatZeroIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWithFalseDoesNotMatch0_floatZeroIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0.0 + """, + """ + {"enum":[false]} + """, + false, + """enum with false does not match 0 -> float zero is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with [false] does not match [0] -> [false] is valid" + */ + @Test + fun enum_enumWith_false_DoesNotMatch_0___false_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith_false_DoesNotMatch_0___false_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false] + """, + """ + {"enum":[[false]]} + """, + true, + """enum with [false] does not match [0] -> [false] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with [false] does not match [0] -> [0] is invalid" + */ + @Test + fun enum_enumWith_false_DoesNotMatch_0___0_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith_false_DoesNotMatch_0___0_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [0] + """, + """ + {"enum":[[false]]} + """, + false, + """enum with [false] does not match [0] -> [0] is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with [false] does not match [0] -> [0.0] is invalid" + */ + @Test + fun enum_enumWith_false_DoesNotMatch_0___0_0_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith_false_DoesNotMatch_0___0_0_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [0.0] + """, + """ + {"enum":[[false]]} + """, + false, + """enum with [false] does not match [0] -> [0.0] is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with true does not match 1 -> true is valid" + */ + @Test + fun enum_enumWithTrueDoesNotMatch1_trueIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWithTrueDoesNotMatch1_trueIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"enum":[true]} + """, + true, + """enum with true does not match 1 -> true is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with true does not match 1 -> integer one is invalid" + */ + @Test + fun enum_enumWithTrueDoesNotMatch1_integerOneIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWithTrueDoesNotMatch1_integerOneIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"enum":[true]} + """, + false, + """enum with true does not match 1 -> integer one is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with true does not match 1 -> float one is invalid" + */ + @Test + fun enum_enumWithTrueDoesNotMatch1_floatOneIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWithTrueDoesNotMatch1_floatOneIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.0 + """, + """ + {"enum":[true]} + """, + false, + """enum with true does not match 1 -> float one is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with [true] does not match [1] -> [true] is valid" + */ + @Test + fun enum_enumWith_true_DoesNotMatch_1___true_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith_true_DoesNotMatch_1___true_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true] + """, + """ + {"enum":[[true]]} + """, + true, + """enum with [true] does not match [1] -> [true] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with [true] does not match [1] -> [1] is invalid" + */ + @Test + fun enum_enumWith_true_DoesNotMatch_1___1_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith_true_DoesNotMatch_1___1_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1] + """, + """ + {"enum":[[true]]} + """, + false, + """enum with [true] does not match [1] -> [1] is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with [true] does not match [1] -> [1.0] is invalid" + */ + @Test + fun enum_enumWith_true_DoesNotMatch_1___1_0_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith_true_DoesNotMatch_1___1_0_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1.0] + """, + """ + {"enum":[[true]]} + """, + false, + """enum with [true] does not match [1] -> [1.0] is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with 0 does not match false -> false is invalid" + */ + @Test + fun enum_enumWith0DoesNotMatchFalse_falseIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith0DoesNotMatchFalse_falseIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"enum":[0]} + """, + false, + """enum with 0 does not match false -> false is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with 0 does not match false -> integer zero is valid" + */ + @Test + fun enum_enumWith0DoesNotMatchFalse_integerZeroIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith0DoesNotMatchFalse_integerZeroIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0 + """, + """ + {"enum":[0]} + """, + true, + """enum with 0 does not match false -> integer zero is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with 0 does not match false -> float zero is valid" + */ + @Test + fun enum_enumWith0DoesNotMatchFalse_floatZeroIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith0DoesNotMatchFalse_floatZeroIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0.0 + """, + """ + {"enum":[0]} + """, + true, + """enum with 0 does not match false -> float zero is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with [0] does not match [false] -> [false] is invalid" + */ + @Test + fun enum_enumWith_0_DoesNotMatch_false___false_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith_0_DoesNotMatch_false___false_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false] + """, + """ + {"enum":[[0]]} + """, + false, + """enum with [0] does not match [false] -> [false] is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with [0] does not match [false] -> [0] is valid" + */ + @Test + fun enum_enumWith_0_DoesNotMatch_false___0_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith_0_DoesNotMatch_false___0_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [0] + """, + """ + {"enum":[[0]]} + """, + true, + """enum with [0] does not match [false] -> [0] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with [0] does not match [false] -> [0.0] is valid" + */ + @Test + fun enum_enumWith_0_DoesNotMatch_false___0_0_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith_0_DoesNotMatch_false___0_0_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [0.0] + """, + """ + {"enum":[[0]]} + """, + true, + """enum with [0] does not match [false] -> [0.0] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with 1 does not match true -> true is invalid" + */ + @Test + fun enum_enumWith1DoesNotMatchTrue_trueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith1DoesNotMatchTrue_trueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"enum":[1]} + """, + false, + """enum with 1 does not match true -> true is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with 1 does not match true -> integer one is valid" + */ + @Test + fun enum_enumWith1DoesNotMatchTrue_integerOneIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith1DoesNotMatchTrue_integerOneIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"enum":[1]} + """, + true, + """enum with 1 does not match true -> integer one is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with 1 does not match true -> float one is valid" + */ + @Test + fun enum_enumWith1DoesNotMatchTrue_floatOneIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith1DoesNotMatchTrue_floatOneIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.0 + """, + """ + {"enum":[1]} + """, + true, + """enum with 1 does not match true -> float one is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with [1] does not match [true] -> [true] is invalid" + */ + @Test + fun enum_enumWith_1_DoesNotMatch_true___true_IsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith_1_DoesNotMatch_true___true_IsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true] + """, + """ + {"enum":[[1]]} + """, + false, + """enum with [1] does not match [true] -> [true] is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with [1] does not match [true] -> [1] is valid" + */ + @Test + fun enum_enumWith_1_DoesNotMatch_true___1_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith_1_DoesNotMatch_true___1_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1] + """, + """ + {"enum":[[1]]} + """, + true, + """enum with [1] does not match [true] -> [1] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "enum with [1] does not match [true] -> [1.0] is valid" + */ + @Test + fun enum_enumWith_1_DoesNotMatch_true___1_0_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_enumWith_1_DoesNotMatch_true___1_0_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1.0] + """, + """ + {"enum":[[1]]} + """, + true, + """enum with [1] does not match [true] -> [1.0] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "nul characters in strings -> match string with nul" + */ + @Test + fun enum_nulCharactersInStrings_matchStringWithNul() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_nulCharactersInStrings_matchStringWithNul" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "hello\u0000there" + """, + """ + {"enum":["hello\u0000there"]} + """, + true, + """nul characters in strings -> match string with nul""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/enum.json`: + * "nul characters in strings -> do not match string lacking nul" + */ + @Test + fun enum_nulCharactersInStrings_doNotMatchStringLackingNul() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "enum_nulCharactersInStrings_doNotMatchStringLackingNul" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "hellothere" + """, + """ + {"enum":["hello\u0000there"]} + """, + false, + """nul characters in strings -> do not match string lacking nul""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/exclusiveMaximum.json`: + * "exclusiveMaximum validation -> below the exclusiveMaximum is valid" + */ + @Test + fun exclusiveMaximum_exclusiveMaximumValidation_belowTheExclusiveMaximumIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "exclusiveMaximum_exclusiveMaximumValidation_belowTheExclusiveMaximumIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 2.2 + """, + """ + {"exclusiveMaximum":3.0} + """, + true, + """exclusiveMaximum validation -> below the exclusiveMaximum is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/exclusiveMaximum.json`: + * "exclusiveMaximum validation -> boundary point is invalid" + */ + @Test + fun exclusiveMaximum_exclusiveMaximumValidation_boundaryPointIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "exclusiveMaximum_exclusiveMaximumValidation_boundaryPointIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3.0 + """, + """ + {"exclusiveMaximum":3.0} + """, + false, + """exclusiveMaximum validation -> boundary point is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/exclusiveMaximum.json`: + * "exclusiveMaximum validation -> above the exclusiveMaximum is invalid" + */ + @Test + fun exclusiveMaximum_exclusiveMaximumValidation_aboveTheExclusiveMaximumIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "exclusiveMaximum_exclusiveMaximumValidation_aboveTheExclusiveMaximumIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3.5 + """, + """ + {"exclusiveMaximum":3.0} + """, + false, + """exclusiveMaximum validation -> above the exclusiveMaximum is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/exclusiveMaximum.json`: + * "exclusiveMaximum validation -> ignores non-numbers" + */ + @Test + fun exclusiveMaximum_exclusiveMaximumValidation_ignoresNon_numbers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "exclusiveMaximum_exclusiveMaximumValidation_ignoresNon_numbers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "x" + """, + """ + {"exclusiveMaximum":3.0} + """, + true, + """exclusiveMaximum validation -> ignores non-numbers""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/exclusiveMinimum.json`: + * "exclusiveMinimum validation -> above the exclusiveMinimum is valid" + */ + @Test + fun exclusiveMinimum_exclusiveMinimumValidation_aboveTheExclusiveMinimumIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "exclusiveMinimum_exclusiveMinimumValidation_aboveTheExclusiveMinimumIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.2 + """, + """ + {"exclusiveMinimum":1.1} + """, + true, + """exclusiveMinimum validation -> above the exclusiveMinimum is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/exclusiveMinimum.json`: + * "exclusiveMinimum validation -> boundary point is invalid" + */ + @Test + fun exclusiveMinimum_exclusiveMinimumValidation_boundaryPointIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "exclusiveMinimum_exclusiveMinimumValidation_boundaryPointIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.1 + """, + """ + {"exclusiveMinimum":1.1} + """, + false, + """exclusiveMinimum validation -> boundary point is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/exclusiveMinimum.json`: + * "exclusiveMinimum validation -> below the exclusiveMinimum is invalid" + */ + @Test + fun exclusiveMinimum_exclusiveMinimumValidation_belowTheExclusiveMinimumIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "exclusiveMinimum_exclusiveMinimumValidation_belowTheExclusiveMinimumIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0.6 + """, + """ + {"exclusiveMinimum":1.1} + """, + false, + """exclusiveMinimum validation -> below the exclusiveMinimum is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/exclusiveMinimum.json`: + * "exclusiveMinimum validation -> ignores non-numbers" + */ + @Test + fun exclusiveMinimum_exclusiveMinimumValidation_ignoresNon_numbers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "exclusiveMinimum_exclusiveMinimumValidation_ignoresNon_numbers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "x" + """, + """ + {"exclusiveMinimum":1.1} + """, + true, + """exclusiveMinimum validation -> ignores non-numbers""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "email format -> all string formats ignore integers" + */ + @Test + fun format_emailFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_emailFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"email"} + """, + true, + """email format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "email format -> all string formats ignore floats" + */ + @Test + fun format_emailFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_emailFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"email"} + """, + true, + """email format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "email format -> all string formats ignore objects" + */ + @Test + fun format_emailFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_emailFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"email"} + """, + true, + """email format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "email format -> all string formats ignore arrays" + */ + @Test + fun format_emailFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_emailFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"email"} + """, + true, + """email format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "email format -> all string formats ignore booleans" + */ + @Test + fun format_emailFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_emailFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"email"} + """, + true, + """email format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "email format -> all string formats ignore nulls" + */ + @Test + fun format_emailFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_emailFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"email"} + """, + true, + """email format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "idn-email format -> all string formats ignore integers" + */ + @Test + fun format_idn_emailFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_idn_emailFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"idn-email"} + """, + true, + """idn-email format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "idn-email format -> all string formats ignore floats" + */ + @Test + fun format_idn_emailFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_idn_emailFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"idn-email"} + """, + true, + """idn-email format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "idn-email format -> all string formats ignore objects" + */ + @Test + fun format_idn_emailFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_idn_emailFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"idn-email"} + """, + true, + """idn-email format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "idn-email format -> all string formats ignore arrays" + */ + @Test + fun format_idn_emailFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_idn_emailFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"idn-email"} + """, + true, + """idn-email format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "idn-email format -> all string formats ignore booleans" + */ + @Test + fun format_idn_emailFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_idn_emailFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"idn-email"} + """, + true, + """idn-email format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "idn-email format -> all string formats ignore nulls" + */ + @Test + fun format_idn_emailFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_idn_emailFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"idn-email"} + """, + true, + """idn-email format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "regex format -> all string formats ignore integers" + */ + @Test + fun format_regexFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_regexFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"regex"} + """, + true, + """regex format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "regex format -> all string formats ignore floats" + */ + @Test + fun format_regexFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_regexFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"regex"} + """, + true, + """regex format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "regex format -> all string formats ignore objects" + */ + @Test + fun format_regexFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_regexFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"regex"} + """, + true, + """regex format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "regex format -> all string formats ignore arrays" + */ + @Test + fun format_regexFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_regexFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"regex"} + """, + true, + """regex format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "regex format -> all string formats ignore booleans" + */ + @Test + fun format_regexFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_regexFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"regex"} + """, + true, + """regex format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "regex format -> all string formats ignore nulls" + */ + @Test + fun format_regexFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_regexFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"regex"} + """, + true, + """regex format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "ipv4 format -> all string formats ignore integers" + */ + @Test + fun format_ipv4Format_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_ipv4Format_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"ipv4"} + """, + true, + """ipv4 format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "ipv4 format -> all string formats ignore floats" + */ + @Test + fun format_ipv4Format_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_ipv4Format_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"ipv4"} + """, + true, + """ipv4 format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "ipv4 format -> all string formats ignore objects" + */ + @Test + fun format_ipv4Format_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_ipv4Format_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"ipv4"} + """, + true, + """ipv4 format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "ipv4 format -> all string formats ignore arrays" + */ + @Test + fun format_ipv4Format_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_ipv4Format_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"ipv4"} + """, + true, + """ipv4 format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "ipv4 format -> all string formats ignore booleans" + */ + @Test + fun format_ipv4Format_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_ipv4Format_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"ipv4"} + """, + true, + """ipv4 format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "ipv4 format -> all string formats ignore nulls" + */ + @Test + fun format_ipv4Format_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_ipv4Format_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"ipv4"} + """, + true, + """ipv4 format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "ipv6 format -> all string formats ignore integers" + */ + @Test + fun format_ipv6Format_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_ipv6Format_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"ipv6"} + """, + true, + """ipv6 format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "ipv6 format -> all string formats ignore floats" + */ + @Test + fun format_ipv6Format_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_ipv6Format_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"ipv6"} + """, + true, + """ipv6 format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "ipv6 format -> all string formats ignore objects" + */ + @Test + fun format_ipv6Format_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_ipv6Format_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"ipv6"} + """, + true, + """ipv6 format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "ipv6 format -> all string formats ignore arrays" + */ + @Test + fun format_ipv6Format_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_ipv6Format_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"ipv6"} + """, + true, + """ipv6 format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "ipv6 format -> all string formats ignore booleans" + */ + @Test + fun format_ipv6Format_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_ipv6Format_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"ipv6"} + """, + true, + """ipv6 format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "ipv6 format -> all string formats ignore nulls" + */ + @Test + fun format_ipv6Format_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_ipv6Format_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"ipv6"} + """, + true, + """ipv6 format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "idn-hostname format -> all string formats ignore integers" + */ + @Test + fun format_idn_hostnameFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_idn_hostnameFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"idn-hostname"} + """, + true, + """idn-hostname format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "idn-hostname format -> all string formats ignore floats" + */ + @Test + fun format_idn_hostnameFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_idn_hostnameFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"idn-hostname"} + """, + true, + """idn-hostname format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "idn-hostname format -> all string formats ignore objects" + */ + @Test + fun format_idn_hostnameFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_idn_hostnameFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"idn-hostname"} + """, + true, + """idn-hostname format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "idn-hostname format -> all string formats ignore arrays" + */ + @Test + fun format_idn_hostnameFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_idn_hostnameFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"idn-hostname"} + """, + true, + """idn-hostname format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "idn-hostname format -> all string formats ignore booleans" + */ + @Test + fun format_idn_hostnameFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_idn_hostnameFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"idn-hostname"} + """, + true, + """idn-hostname format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "idn-hostname format -> all string formats ignore nulls" + */ + @Test + fun format_idn_hostnameFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_idn_hostnameFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"idn-hostname"} + """, + true, + """idn-hostname format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "hostname format -> all string formats ignore integers" + */ + @Test + fun format_hostnameFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_hostnameFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"hostname"} + """, + true, + """hostname format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "hostname format -> all string formats ignore floats" + */ + @Test + fun format_hostnameFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_hostnameFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"hostname"} + """, + true, + """hostname format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "hostname format -> all string formats ignore objects" + */ + @Test + fun format_hostnameFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_hostnameFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"hostname"} + """, + true, + """hostname format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "hostname format -> all string formats ignore arrays" + */ + @Test + fun format_hostnameFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_hostnameFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"hostname"} + """, + true, + """hostname format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "hostname format -> all string formats ignore booleans" + */ + @Test + fun format_hostnameFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_hostnameFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"hostname"} + """, + true, + """hostname format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "hostname format -> all string formats ignore nulls" + */ + @Test + fun format_hostnameFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_hostnameFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"hostname"} + """, + true, + """hostname format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "date format -> all string formats ignore integers" + */ + @Test + fun format_dateFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_dateFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"date"} + """, + true, + """date format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "date format -> all string formats ignore floats" + */ + @Test + fun format_dateFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_dateFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"date"} + """, + true, + """date format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "date format -> all string formats ignore objects" + */ + @Test + fun format_dateFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_dateFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"date"} + """, + true, + """date format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "date format -> all string formats ignore arrays" + */ + @Test + fun format_dateFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_dateFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"date"} + """, + true, + """date format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "date format -> all string formats ignore booleans" + */ + @Test + fun format_dateFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_dateFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"date"} + """, + true, + """date format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "date format -> all string formats ignore nulls" + */ + @Test + fun format_dateFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_dateFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"date"} + """, + true, + """date format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "date-time format -> all string formats ignore integers" + */ + @Test + fun format_date_timeFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_date_timeFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"date-time"} + """, + true, + """date-time format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "date-time format -> all string formats ignore floats" + */ + @Test + fun format_date_timeFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_date_timeFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"date-time"} + """, + true, + """date-time format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "date-time format -> all string formats ignore objects" + */ + @Test + fun format_date_timeFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_date_timeFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"date-time"} + """, + true, + """date-time format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "date-time format -> all string formats ignore arrays" + */ + @Test + fun format_date_timeFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_date_timeFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"date-time"} + """, + true, + """date-time format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "date-time format -> all string formats ignore booleans" + */ + @Test + fun format_date_timeFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_date_timeFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"date-time"} + """, + true, + """date-time format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "date-time format -> all string formats ignore nulls" + */ + @Test + fun format_date_timeFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_date_timeFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"date-time"} + """, + true, + """date-time format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "time format -> all string formats ignore integers" + */ + @Test + fun format_timeFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_timeFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"time"} + """, + true, + """time format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "time format -> all string formats ignore floats" + */ + @Test + fun format_timeFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_timeFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"time"} + """, + true, + """time format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "time format -> all string formats ignore objects" + */ + @Test + fun format_timeFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_timeFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"time"} + """, + true, + """time format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "time format -> all string formats ignore arrays" + */ + @Test + fun format_timeFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_timeFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"time"} + """, + true, + """time format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "time format -> all string formats ignore booleans" + */ + @Test + fun format_timeFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_timeFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"time"} + """, + true, + """time format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "time format -> all string formats ignore nulls" + */ + @Test + fun format_timeFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_timeFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"time"} + """, + true, + """time format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "json-pointer format -> all string formats ignore integers" + */ + @Test + fun format_json_pointerFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_json_pointerFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"json-pointer"} + """, + true, + """json-pointer format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "json-pointer format -> all string formats ignore floats" + */ + @Test + fun format_json_pointerFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_json_pointerFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"json-pointer"} + """, + true, + """json-pointer format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "json-pointer format -> all string formats ignore objects" + */ + @Test + fun format_json_pointerFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_json_pointerFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"json-pointer"} + """, + true, + """json-pointer format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "json-pointer format -> all string formats ignore arrays" + */ + @Test + fun format_json_pointerFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_json_pointerFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"json-pointer"} + """, + true, + """json-pointer format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "json-pointer format -> all string formats ignore booleans" + */ + @Test + fun format_json_pointerFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_json_pointerFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"json-pointer"} + """, + true, + """json-pointer format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "json-pointer format -> all string formats ignore nulls" + */ + @Test + fun format_json_pointerFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_json_pointerFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"json-pointer"} + """, + true, + """json-pointer format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "relative-json-pointer format -> all string formats ignore integers" + */ + @Test + fun format_relative_json_pointerFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_relative_json_pointerFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"relative-json-pointer"} + """, + true, + """relative-json-pointer format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "relative-json-pointer format -> all string formats ignore floats" + */ + @Test + fun format_relative_json_pointerFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_relative_json_pointerFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"relative-json-pointer"} + """, + true, + """relative-json-pointer format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "relative-json-pointer format -> all string formats ignore objects" + */ + @Test + fun format_relative_json_pointerFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_relative_json_pointerFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"relative-json-pointer"} + """, + true, + """relative-json-pointer format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "relative-json-pointer format -> all string formats ignore arrays" + */ + @Test + fun format_relative_json_pointerFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_relative_json_pointerFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"relative-json-pointer"} + """, + true, + """relative-json-pointer format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "relative-json-pointer format -> all string formats ignore booleans" + */ + @Test + fun format_relative_json_pointerFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_relative_json_pointerFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"relative-json-pointer"} + """, + true, + """relative-json-pointer format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "relative-json-pointer format -> all string formats ignore nulls" + */ + @Test + fun format_relative_json_pointerFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_relative_json_pointerFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"relative-json-pointer"} + """, + true, + """relative-json-pointer format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "iri format -> all string formats ignore integers" + */ + @Test + fun format_iriFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_iriFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"iri"} + """, + true, + """iri format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "iri format -> all string formats ignore floats" + */ + @Test + fun format_iriFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_iriFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"iri"} + """, + true, + """iri format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "iri format -> all string formats ignore objects" + */ + @Test + fun format_iriFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_iriFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"iri"} + """, + true, + """iri format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "iri format -> all string formats ignore arrays" + */ + @Test + fun format_iriFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_iriFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"iri"} + """, + true, + """iri format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "iri format -> all string formats ignore booleans" + */ + @Test + fun format_iriFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_iriFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"iri"} + """, + true, + """iri format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "iri format -> all string formats ignore nulls" + */ + @Test + fun format_iriFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_iriFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"iri"} + """, + true, + """iri format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "iri-reference format -> all string formats ignore integers" + */ + @Test + fun format_iri_referenceFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_iri_referenceFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"iri-reference"} + """, + true, + """iri-reference format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "iri-reference format -> all string formats ignore floats" + */ + @Test + fun format_iri_referenceFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_iri_referenceFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"iri-reference"} + """, + true, + """iri-reference format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "iri-reference format -> all string formats ignore objects" + */ + @Test + fun format_iri_referenceFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_iri_referenceFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"iri-reference"} + """, + true, + """iri-reference format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "iri-reference format -> all string formats ignore arrays" + */ + @Test + fun format_iri_referenceFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_iri_referenceFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"iri-reference"} + """, + true, + """iri-reference format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "iri-reference format -> all string formats ignore booleans" + */ + @Test + fun format_iri_referenceFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_iri_referenceFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"iri-reference"} + """, + true, + """iri-reference format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "iri-reference format -> all string formats ignore nulls" + */ + @Test + fun format_iri_referenceFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_iri_referenceFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"iri-reference"} + """, + true, + """iri-reference format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri format -> all string formats ignore integers" + */ + @Test + fun format_uriFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uriFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"uri"} + """, + true, + """uri format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri format -> all string formats ignore floats" + */ + @Test + fun format_uriFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uriFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"uri"} + """, + true, + """uri format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri format -> all string formats ignore objects" + */ + @Test + fun format_uriFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uriFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"uri"} + """, + true, + """uri format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri format -> all string formats ignore arrays" + */ + @Test + fun format_uriFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uriFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"uri"} + """, + true, + """uri format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri format -> all string formats ignore booleans" + */ + @Test + fun format_uriFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uriFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"uri"} + """, + true, + """uri format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri format -> all string formats ignore nulls" + */ + @Test + fun format_uriFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uriFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"uri"} + """, + true, + """uri format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri-reference format -> all string formats ignore integers" + */ + @Test + fun format_uri_referenceFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uri_referenceFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"uri-reference"} + """, + true, + """uri-reference format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri-reference format -> all string formats ignore floats" + */ + @Test + fun format_uri_referenceFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uri_referenceFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"uri-reference"} + """, + true, + """uri-reference format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri-reference format -> all string formats ignore objects" + */ + @Test + fun format_uri_referenceFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uri_referenceFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"uri-reference"} + """, + true, + """uri-reference format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri-reference format -> all string formats ignore arrays" + */ + @Test + fun format_uri_referenceFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uri_referenceFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"uri-reference"} + """, + true, + """uri-reference format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri-reference format -> all string formats ignore booleans" + */ + @Test + fun format_uri_referenceFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uri_referenceFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"uri-reference"} + """, + true, + """uri-reference format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri-reference format -> all string formats ignore nulls" + */ + @Test + fun format_uri_referenceFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uri_referenceFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"uri-reference"} + """, + true, + """uri-reference format -> all string formats ignore nulls""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri-template format -> all string formats ignore integers" + */ + @Test + fun format_uri_templateFormat_allStringFormatsIgnoreIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uri_templateFormat_allStringFormatsIgnoreIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"format":"uri-template"} + """, + true, + """uri-template format -> all string formats ignore integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri-template format -> all string formats ignore floats" + */ + @Test + fun format_uri_templateFormat_allStringFormatsIgnoreFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uri_templateFormat_allStringFormatsIgnoreFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 13.7 + """, + """ + {"format":"uri-template"} + """, + true, + """uri-template format -> all string formats ignore floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri-template format -> all string formats ignore objects" + */ + @Test + fun format_uri_templateFormat_allStringFormatsIgnoreObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uri_templateFormat_allStringFormatsIgnoreObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"format":"uri-template"} + """, + true, + """uri-template format -> all string formats ignore objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri-template format -> all string formats ignore arrays" + */ + @Test + fun format_uri_templateFormat_allStringFormatsIgnoreArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uri_templateFormat_allStringFormatsIgnoreArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"format":"uri-template"} + """, + true, + """uri-template format -> all string formats ignore arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri-template format -> all string formats ignore booleans" + */ + @Test + fun format_uri_templateFormat_allStringFormatsIgnoreBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uri_templateFormat_allStringFormatsIgnoreBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"format":"uri-template"} + """, + true, + """uri-template format -> all string formats ignore booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/format.json`: + * "uri-template format -> all string formats ignore nulls" + */ + @Test + fun format_uri_templateFormat_allStringFormatsIgnoreNulls() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "format_uri_templateFormat_allStringFormatsIgnoreNulls" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"format":"uri-template"} + """, + true, + """uri-template format -> all string formats ignore nulls""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "ignore if without then or else -> valid when valid against lone if" + */ + @Test + fun if_then_else_ignoreIfWithoutThenOrElse_validWhenValidAgainstLoneIf() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ignoreIfWithoutThenOrElse_validWhenValidAgainstLoneIf" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0 + """, + """ + {"if":{"const":0}} + """, + true, + """ignore if without then or else -> valid when valid against lone if""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "ignore if without then or else -> valid when invalid against lone if" + */ + @Test + fun if_then_else_ignoreIfWithoutThenOrElse_validWhenInvalidAgainstLoneIf() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ignoreIfWithoutThenOrElse_validWhenInvalidAgainstLoneIf" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "hello" + """, + """ + {"if":{"const":0}} + """, + true, + """ignore if without then or else -> valid when invalid against lone if""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "ignore then without if -> valid when valid against lone then" + */ + @Test + fun if_then_else_ignoreThenWithoutIf_validWhenValidAgainstLoneThen() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ignoreThenWithoutIf_validWhenValidAgainstLoneThen" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0 + """, + """ + {"then":{"const":0}} + """, + true, + """ignore then without if -> valid when valid against lone then""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "ignore then without if -> valid when invalid against lone then" + */ + @Test + fun if_then_else_ignoreThenWithoutIf_validWhenInvalidAgainstLoneThen() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ignoreThenWithoutIf_validWhenInvalidAgainstLoneThen" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "hello" + """, + """ + {"then":{"const":0}} + """, + true, + """ignore then without if -> valid when invalid against lone then""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "ignore else without if -> valid when valid against lone else" + */ + @Test + fun if_then_else_ignoreElseWithoutIf_validWhenValidAgainstLoneElse() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ignoreElseWithoutIf_validWhenValidAgainstLoneElse" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0 + """, + """ + {"else":{"const":0}} + """, + true, + """ignore else without if -> valid when valid against lone else""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "ignore else without if -> valid when invalid against lone else" + */ + @Test + fun if_then_else_ignoreElseWithoutIf_validWhenInvalidAgainstLoneElse() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ignoreElseWithoutIf_validWhenInvalidAgainstLoneElse" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "hello" + """, + """ + {"else":{"const":0}} + """, + true, + """ignore else without if -> valid when invalid against lone else""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if and then without else -> valid through then" + */ + @Test + fun if_then_else_ifAndThenWithoutElse_validThroughThen() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifAndThenWithoutElse_validThroughThen" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -1 + """, + """ + {"if":{"exclusiveMaximum":0},"then":{"minimum":-10}} + """, + true, + """if and then without else -> valid through then""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if and then without else -> invalid through then" + */ + @Test + fun if_then_else_ifAndThenWithoutElse_invalidThroughThen() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifAndThenWithoutElse_invalidThroughThen" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -100 + """, + """ + {"if":{"exclusiveMaximum":0},"then":{"minimum":-10}} + """, + false, + """if and then without else -> invalid through then""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if and then without else -> valid when if test fails" + */ + @Test + fun if_then_else_ifAndThenWithoutElse_validWhenIfTestFails() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifAndThenWithoutElse_validWhenIfTestFails" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3 + """, + """ + {"if":{"exclusiveMaximum":0},"then":{"minimum":-10}} + """, + true, + """if and then without else -> valid when if test fails""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if and else without then -> valid when if test passes" + */ + @Test + fun if_then_else_ifAndElseWithoutThen_validWhenIfTestPasses() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifAndElseWithoutThen_validWhenIfTestPasses" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -1 + """, + """ + {"if":{"exclusiveMaximum":0},"else":{"multipleOf":2}} + """, + true, + """if and else without then -> valid when if test passes""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if and else without then -> valid through else" + */ + @Test + fun if_then_else_ifAndElseWithoutThen_validThroughElse() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifAndElseWithoutThen_validThroughElse" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 4 + """, + """ + {"if":{"exclusiveMaximum":0},"else":{"multipleOf":2}} + """, + true, + """if and else without then -> valid through else""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if and else without then -> invalid through else" + */ + @Test + fun if_then_else_ifAndElseWithoutThen_invalidThroughElse() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifAndElseWithoutThen_invalidThroughElse" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3 + """, + """ + {"if":{"exclusiveMaximum":0},"else":{"multipleOf":2}} + """, + false, + """if and else without then -> invalid through else""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "validate against correct branch, then vs else -> valid through then" + */ + @Test + fun if_then_else_validateAgainstCorrectBranch_ThenVsElse_validThroughThen() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_validateAgainstCorrectBranch_ThenVsElse_validThroughThen" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -1 + """, + """ + {"if":{"exclusiveMaximum":0},"then":{"minimum":-10},"else":{"multipleOf":2}} + """, + true, + """validate against correct branch, then vs else -> valid through then""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "validate against correct branch, then vs else -> invalid through then" + */ + @Test + fun if_then_else_validateAgainstCorrectBranch_ThenVsElse_invalidThroughThen() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_validateAgainstCorrectBranch_ThenVsElse_invalidThroughThen" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -100 + """, + """ + {"if":{"exclusiveMaximum":0},"then":{"minimum":-10},"else":{"multipleOf":2}} + """, + false, + """validate against correct branch, then vs else -> invalid through then""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "validate against correct branch, then vs else -> valid through else" + */ + @Test + fun if_then_else_validateAgainstCorrectBranch_ThenVsElse_validThroughElse() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_validateAgainstCorrectBranch_ThenVsElse_validThroughElse" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 4 + """, + """ + {"if":{"exclusiveMaximum":0},"then":{"minimum":-10},"else":{"multipleOf":2}} + """, + true, + """validate against correct branch, then vs else -> valid through else""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "validate against correct branch, then vs else -> invalid through else" + */ + @Test + fun if_then_else_validateAgainstCorrectBranch_ThenVsElse_invalidThroughElse() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_validateAgainstCorrectBranch_ThenVsElse_invalidThroughElse" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3 + """, + """ + {"if":{"exclusiveMaximum":0},"then":{"minimum":-10},"else":{"multipleOf":2}} + """, + false, + """validate against correct branch, then vs else -> invalid through else""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "non-interference across combined schemas -> valid, but would have been invalid through then" + */ + @Test + fun if_then_else_non_interferenceAcrossCombinedSchemas_valid_ButWouldHaveBeenInvalidThroughThen() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_non_interferenceAcrossCombinedSchemas_valid_ButWouldHaveBeenInvalidThroughThen" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -100 + """, + """ + {"allOf":[{"if":{"exclusiveMaximum":0}},{"then":{"minimum":-10}},{"else":{"multipleOf":2}}]} + """, + true, + """non-interference across combined schemas -> valid, but would have been invalid through then""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "non-interference across combined schemas -> valid, but would have been invalid through else" + */ + @Test + fun if_then_else_non_interferenceAcrossCombinedSchemas_valid_ButWouldHaveBeenInvalidThroughElse() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_non_interferenceAcrossCombinedSchemas_valid_ButWouldHaveBeenInvalidThroughElse" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3 + """, + """ + {"allOf":[{"if":{"exclusiveMaximum":0}},{"then":{"minimum":-10}},{"else":{"multipleOf":2}}]} + """, + true, + """non-interference across combined schemas -> valid, but would have been invalid through else""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if with boolean schema true -> boolean schema true in if always chooses the then path (valid)" + */ + @Test + fun if_then_else_ifWithBooleanSchemaTrue_booleanSchemaTrueInIfAlwaysChoosesTheThenPath_valid_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifWithBooleanSchemaTrue_booleanSchemaTrueInIfAlwaysChoosesTheThenPath_valid_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "then" + """, + """ + {"if":true,"then":{"const":"then"},"else":{"const":"else"}} + """, + true, + """if with boolean schema true -> boolean schema true in if always chooses the then path (valid)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if with boolean schema true -> boolean schema true in if always chooses the then path (invalid)" + */ + @Test + fun if_then_else_ifWithBooleanSchemaTrue_booleanSchemaTrueInIfAlwaysChoosesTheThenPath_invalid_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifWithBooleanSchemaTrue_booleanSchemaTrueInIfAlwaysChoosesTheThenPath_invalid_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "else" + """, + """ + {"if":true,"then":{"const":"then"},"else":{"const":"else"}} + """, + false, + """if with boolean schema true -> boolean schema true in if always chooses the then path (invalid)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if with boolean schema false -> boolean schema false in if always chooses the else path (invalid)" + */ + @Test + fun if_then_else_ifWithBooleanSchemaFalse_booleanSchemaFalseInIfAlwaysChoosesTheElsePath_invalid_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifWithBooleanSchemaFalse_booleanSchemaFalseInIfAlwaysChoosesTheElsePath_invalid_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "then" + """, + """ + {"if":false,"then":{"const":"then"},"else":{"const":"else"}} + """, + false, + """if with boolean schema false -> boolean schema false in if always chooses the else path (invalid)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if with boolean schema false -> boolean schema false in if always chooses the else path (valid)" + */ + @Test + fun if_then_else_ifWithBooleanSchemaFalse_booleanSchemaFalseInIfAlwaysChoosesTheElsePath_valid_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifWithBooleanSchemaFalse_booleanSchemaFalseInIfAlwaysChoosesTheElsePath_valid_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "else" + """, + """ + {"if":false,"then":{"const":"then"},"else":{"const":"else"}} + """, + true, + """if with boolean schema false -> boolean schema false in if always chooses the else path (valid)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if appears at the end when serialized (keyword processing sequence) -> yes redirects to then and passes" + */ + @Test + fun if_then_else_ifAppearsAtTheEndWhenSerialized_keywordProcessingSequence__yesRedirectsToThenAndPasses() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifAppearsAtTheEndWhenSerialized_keywordProcessingSequence__yesRedirectsToThenAndPasses" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "yes" + """, + """ + {"then":{"const":"yes"},"else":{"const":"other"},"if":{"maxLength":4}} + """, + true, + """if appears at the end when serialized (keyword processing sequence) -> yes redirects to then and passes""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if appears at the end when serialized (keyword processing sequence) -> other redirects to else and passes" + */ + @Test + fun if_then_else_ifAppearsAtTheEndWhenSerialized_keywordProcessingSequence__otherRedirectsToElseAndPasses() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifAppearsAtTheEndWhenSerialized_keywordProcessingSequence__otherRedirectsToElseAndPasses" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "other" + """, + """ + {"then":{"const":"yes"},"else":{"const":"other"},"if":{"maxLength":4}} + """, + true, + """if appears at the end when serialized (keyword processing sequence) -> other redirects to else and passes""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if appears at the end when serialized (keyword processing sequence) -> no redirects to then and fails" + */ + @Test + fun if_then_else_ifAppearsAtTheEndWhenSerialized_keywordProcessingSequence__noRedirectsToThenAndFails() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifAppearsAtTheEndWhenSerialized_keywordProcessingSequence__noRedirectsToThenAndFails" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "no" + """, + """ + {"then":{"const":"yes"},"else":{"const":"other"},"if":{"maxLength":4}} + """, + false, + """if appears at the end when serialized (keyword processing sequence) -> no redirects to then and fails""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/if-then-else.json`: + * "if appears at the end when serialized (keyword processing sequence) -> invalid redirects to else and fails" + */ + @Test + fun if_then_else_ifAppearsAtTheEndWhenSerialized_keywordProcessingSequence__invalidRedirectsToElseAndFails() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "if_then_else_ifAppearsAtTheEndWhenSerialized_keywordProcessingSequence__invalidRedirectsToElseAndFails" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "invalid" + """, + """ + {"then":{"const":"yes"},"else":{"const":"other"},"if":{"maxLength":4}} + """, + false, + """if appears at the end when serialized (keyword processing sequence) -> invalid redirects to else and fails""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/infinite-loop-detection.json`: + * "evaluating the same schema location against the same data location twice is not a sign of an infinite loop -> passing case" + */ + @Test + fun infinite_loop_detection_evaluatingTheSameSchemaLocationAgainstTheSameDataLocationTwiceIsNotASignOfAnInfiniteLoop_passingCase() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "infinite_loop_detection_evaluatingTheSameSchemaLocationAgainstTheSameDataLocationTwiceIsNotASignOfAnInfiniteLoop_passingCase" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"definitions":{"int":{"type":"integer"}},"allOf":[{"properties":{"foo":{"${'$'}ref":"#/definitions/int"}}},{"additionalProperties":{"${'$'}ref":"#/definitions/int"}}]} + """, + true, + """evaluating the same schema location against the same data location twice is not a sign of an infinite loop -> passing case""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/infinite-loop-detection.json`: + * "evaluating the same schema location against the same data location twice is not a sign of an infinite loop -> failing case" + */ + @Test + fun infinite_loop_detection_evaluatingTheSameSchemaLocationAgainstTheSameDataLocationTwiceIsNotASignOfAnInfiniteLoop_failingCase() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "infinite_loop_detection_evaluatingTheSameSchemaLocationAgainstTheSameDataLocationTwiceIsNotASignOfAnInfiniteLoop_failingCase" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"a string"} + """, + """ + {"definitions":{"int":{"type":"integer"}},"allOf":[{"properties":{"foo":{"${'$'}ref":"#/definitions/int"}}},{"additionalProperties":{"${'$'}ref":"#/definitions/int"}}]} + """, + false, + """evaluating the same schema location against the same data location twice is not a sign of an infinite loop -> failing case""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "a schema given for items -> valid items" + */ + @Test + fun items_aSchemaGivenForItems_validItems() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_aSchemaGivenForItems_validItems" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3] + """, + """ + {"items":{"type":"integer"}} + """, + true, + """a schema given for items -> valid items""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "a schema given for items -> wrong type of items" + */ + @Test + fun items_aSchemaGivenForItems_wrongTypeOfItems() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_aSchemaGivenForItems_wrongTypeOfItems" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,"x"] + """, + """ + {"items":{"type":"integer"}} + """, + false, + """a schema given for items -> wrong type of items""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "a schema given for items -> ignores non-arrays" + */ + @Test + fun items_aSchemaGivenForItems_ignoresNon_arrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_aSchemaGivenForItems_ignoresNon_arrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"items":{"type":"integer"}} + """, + true, + """a schema given for items -> ignores non-arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "a schema given for items -> JavaScript pseudo-array is valid" + */ + @Test + fun items_aSchemaGivenForItems_javaScriptPseudo_arrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_aSchemaGivenForItems_javaScriptPseudo_arrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"0":"invalid","length":1} + """, + """ + {"items":{"type":"integer"}} + """, + true, + """a schema given for items -> JavaScript pseudo-array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "an array of schemas for items -> correct types" + */ + @Test + fun items_anArrayOfSchemasForItems_correctTypes() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_anArrayOfSchemasForItems_correctTypes" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,"foo"] + """, + """ + {"items":[{"type":"integer"},{"type":"string"}]} + """, + true, + """an array of schemas for items -> correct types""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "an array of schemas for items -> wrong types" + */ + @Test + fun items_anArrayOfSchemasForItems_wrongTypes() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_anArrayOfSchemasForItems_wrongTypes" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["foo",1] + """, + """ + {"items":[{"type":"integer"},{"type":"string"}]} + """, + false, + """an array of schemas for items -> wrong types""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "an array of schemas for items -> incomplete array of items" + */ + @Test + fun items_anArrayOfSchemasForItems_incompleteArrayOfItems() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_anArrayOfSchemasForItems_incompleteArrayOfItems" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1] + """, + """ + {"items":[{"type":"integer"},{"type":"string"}]} + """, + true, + """an array of schemas for items -> incomplete array of items""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "an array of schemas for items -> array with additional items" + */ + @Test + fun items_anArrayOfSchemasForItems_arrayWithAdditionalItems() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_anArrayOfSchemasForItems_arrayWithAdditionalItems" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,"foo",true] + """, + """ + {"items":[{"type":"integer"},{"type":"string"}]} + """, + true, + """an array of schemas for items -> array with additional items""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "an array of schemas for items -> empty array" + */ + @Test + fun items_anArrayOfSchemasForItems_emptyArray() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_anArrayOfSchemasForItems_emptyArray" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"items":[{"type":"integer"},{"type":"string"}]} + """, + true, + """an array of schemas for items -> empty array""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "an array of schemas for items -> JavaScript pseudo-array is valid" + */ + @Test + fun items_anArrayOfSchemasForItems_javaScriptPseudo_arrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_anArrayOfSchemasForItems_javaScriptPseudo_arrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"0":"invalid","1":"valid","length":2} + """, + """ + {"items":[{"type":"integer"},{"type":"string"}]} + """, + true, + """an array of schemas for items -> JavaScript pseudo-array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items with boolean schema (true) -> any array is valid" + */ + @Test + fun items_itemsWithBooleanSchema_true__anyArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsWithBooleanSchema_true__anyArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,"foo",true] + """, + """ + {"items":true} + """, + true, + """items with boolean schema (true) -> any array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items with boolean schema (true) -> empty array is valid" + */ + @Test + fun items_itemsWithBooleanSchema_true__emptyArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsWithBooleanSchema_true__emptyArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"items":true} + """, + true, + """items with boolean schema (true) -> empty array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items with boolean schema (false) -> any non-empty array is invalid" + */ + @Test + fun items_itemsWithBooleanSchema_false__anyNon_emptyArrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsWithBooleanSchema_false__anyNon_emptyArrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,"foo",true] + """, + """ + {"items":false} + """, + false, + """items with boolean schema (false) -> any non-empty array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items with boolean schema (false) -> empty array is valid" + */ + @Test + fun items_itemsWithBooleanSchema_false__emptyArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsWithBooleanSchema_false__emptyArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"items":false} + """, + true, + """items with boolean schema (false) -> empty array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items with boolean schemas -> array with one item is valid" + */ + @Test + fun items_itemsWithBooleanSchemas_arrayWithOneItemIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsWithBooleanSchemas_arrayWithOneItemIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1] + """, + """ + {"items":[true,false]} + """, + true, + """items with boolean schemas -> array with one item is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items with boolean schemas -> array with two items is invalid" + */ + @Test + fun items_itemsWithBooleanSchemas_arrayWithTwoItemsIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsWithBooleanSchemas_arrayWithTwoItemsIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,"foo"] + """, + """ + {"items":[true,false]} + """, + false, + """items with boolean schemas -> array with two items is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items with boolean schemas -> empty array is valid" + */ + @Test + fun items_itemsWithBooleanSchemas_emptyArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsWithBooleanSchemas_emptyArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"items":[true,false]} + """, + true, + """items with boolean schemas -> empty array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items and subitems -> valid items" + */ + @Test + fun items_itemsAndSubitems_validItems() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsAndSubitems_validItems" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[{"foo":null},{"foo":null}],[{"foo":null},{"foo":null}],[{"foo":null},{"foo":null}]] + """, + """ + {"definitions":{"item":{"type":"array","additionalItems":false,"items":[{"${'$'}ref":"#/definitions/sub-item"},{"${'$'}ref":"#/definitions/sub-item"}]},"sub-item":{"type":"object","required":["foo"]}},"type":"array","additionalItems":false,"items":[{"${'$'}ref":"#/definitions/item"},{"${'$'}ref":"#/definitions/item"},{"${'$'}ref":"#/definitions/item"}]} + """, + true, + """items and subitems -> valid items""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items and subitems -> too many items" + */ + @Test + fun items_itemsAndSubitems_tooManyItems() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsAndSubitems_tooManyItems" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[{"foo":null},{"foo":null}],[{"foo":null},{"foo":null}],[{"foo":null},{"foo":null}],[{"foo":null},{"foo":null}]] + """, + """ + {"definitions":{"item":{"type":"array","additionalItems":false,"items":[{"${'$'}ref":"#/definitions/sub-item"},{"${'$'}ref":"#/definitions/sub-item"}]},"sub-item":{"type":"object","required":["foo"]}},"type":"array","additionalItems":false,"items":[{"${'$'}ref":"#/definitions/item"},{"${'$'}ref":"#/definitions/item"},{"${'$'}ref":"#/definitions/item"}]} + """, + false, + """items and subitems -> too many items""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items and subitems -> too many sub-items" + */ + @Test + fun items_itemsAndSubitems_tooManySub_items() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsAndSubitems_tooManySub_items" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[{"foo":null},{"foo":null},{"foo":null}],[{"foo":null},{"foo":null}],[{"foo":null},{"foo":null}]] + """, + """ + {"definitions":{"item":{"type":"array","additionalItems":false,"items":[{"${'$'}ref":"#/definitions/sub-item"},{"${'$'}ref":"#/definitions/sub-item"}]},"sub-item":{"type":"object","required":["foo"]}},"type":"array","additionalItems":false,"items":[{"${'$'}ref":"#/definitions/item"},{"${'$'}ref":"#/definitions/item"},{"${'$'}ref":"#/definitions/item"}]} + """, + false, + """items and subitems -> too many sub-items""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items and subitems -> wrong item" + */ + @Test + fun items_itemsAndSubitems_wrongItem() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsAndSubitems_wrongItem" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"foo":null},[{"foo":null},{"foo":null}],[{"foo":null},{"foo":null}]] + """, + """ + {"definitions":{"item":{"type":"array","additionalItems":false,"items":[{"${'$'}ref":"#/definitions/sub-item"},{"${'$'}ref":"#/definitions/sub-item"}]},"sub-item":{"type":"object","required":["foo"]}},"type":"array","additionalItems":false,"items":[{"${'$'}ref":"#/definitions/item"},{"${'$'}ref":"#/definitions/item"},{"${'$'}ref":"#/definitions/item"}]} + """, + false, + """items and subitems -> wrong item""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items and subitems -> wrong sub-item" + */ + @Test + fun items_itemsAndSubitems_wrongSub_item() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsAndSubitems_wrongSub_item" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[{},{"foo":null}],[{"foo":null},{"foo":null}],[{"foo":null},{"foo":null}]] + """, + """ + {"definitions":{"item":{"type":"array","additionalItems":false,"items":[{"${'$'}ref":"#/definitions/sub-item"},{"${'$'}ref":"#/definitions/sub-item"}]},"sub-item":{"type":"object","required":["foo"]}},"type":"array","additionalItems":false,"items":[{"${'$'}ref":"#/definitions/item"},{"${'$'}ref":"#/definitions/item"},{"${'$'}ref":"#/definitions/item"}]} + """, + false, + """items and subitems -> wrong sub-item""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "items and subitems -> fewer items is valid" + */ + @Test + fun items_itemsAndSubitems_fewerItemsIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_itemsAndSubitems_fewerItemsIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[{"foo":null}],[{"foo":null}]] + """, + """ + {"definitions":{"item":{"type":"array","additionalItems":false,"items":[{"${'$'}ref":"#/definitions/sub-item"},{"${'$'}ref":"#/definitions/sub-item"}]},"sub-item":{"type":"object","required":["foo"]}},"type":"array","additionalItems":false,"items":[{"${'$'}ref":"#/definitions/item"},{"${'$'}ref":"#/definitions/item"},{"${'$'}ref":"#/definitions/item"}]} + """, + true, + """items and subitems -> fewer items is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "nested items -> valid nested array" + */ + @Test + fun items_nestedItems_validNestedArray() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_nestedItems_validNestedArray" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[[[1]],[[2],[3]]],[[[4],[5],[6]]]] + """, + """ + {"type":"array","items":{"type":"array","items":{"type":"array","items":{"type":"array","items":{"type":"number"}}}}} + """, + true, + """nested items -> valid nested array""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "nested items -> nested array with invalid type" + */ + @Test + fun items_nestedItems_nestedArrayWithInvalidType() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_nestedItems_nestedArrayWithInvalidType" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[[["1"]],[[2],[3]]],[[[4],[5],[6]]]] + """, + """ + {"type":"array","items":{"type":"array","items":{"type":"array","items":{"type":"array","items":{"type":"number"}}}}} + """, + false, + """nested items -> nested array with invalid type""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "nested items -> not deep enough" + */ + @Test + fun items_nestedItems_notDeepEnough() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_nestedItems_notDeepEnough" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[[1],[2],[3]],[[4],[5],[6]]] + """, + """ + {"type":"array","items":{"type":"array","items":{"type":"array","items":{"type":"array","items":{"type":"number"}}}}} + """, + false, + """nested items -> not deep enough""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "single-form items with null instance elements -> allows null elements" + */ + @Test + fun items_single_formItemsWithNullInstanceElements_allowsNullElements() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_single_formItemsWithNullInstanceElements_allowsNullElements" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [null] + """, + """ + {"items":{"type":"null"}} + """, + true, + """single-form items with null instance elements -> allows null elements""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/items.json`: + * "array-form items with null instance elements -> allows null elements" + */ + @Test + fun items_array_formItemsWithNullInstanceElements_allowsNullElements() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "items_array_formItemsWithNullInstanceElements_allowsNullElements" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [null] + """, + """ + {"items":[{"type":"null"}]} + """, + true, + """array-form items with null instance elements -> allows null elements""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxItems.json`: + * "maxItems validation -> shorter is valid" + */ + @Test + fun maxItems_maxItemsValidation_shorterIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxItems_maxItemsValidation_shorterIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1] + """, + """ + {"maxItems":2} + """, + true, + """maxItems validation -> shorter is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxItems.json`: + * "maxItems validation -> exact length is valid" + */ + @Test + fun maxItems_maxItemsValidation_exactLengthIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxItems_maxItemsValidation_exactLengthIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2] + """, + """ + {"maxItems":2} + """, + true, + """maxItems validation -> exact length is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxItems.json`: + * "maxItems validation -> too long is invalid" + */ + @Test + fun maxItems_maxItemsValidation_tooLongIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxItems_maxItemsValidation_tooLongIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3] + """, + """ + {"maxItems":2} + """, + false, + """maxItems validation -> too long is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxItems.json`: + * "maxItems validation -> ignores non-arrays" + */ + @Test + fun maxItems_maxItemsValidation_ignoresNon_arrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxItems_maxItemsValidation_ignoresNon_arrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foobar" + """, + """ + {"maxItems":2} + """, + true, + """maxItems validation -> ignores non-arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxItems.json`: + * "maxItems validation with a decimal -> shorter is valid" + */ + @Test + fun maxItems_maxItemsValidationWithADecimal_shorterIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxItems_maxItemsValidationWithADecimal_shorterIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1] + """, + """ + {"maxItems":2.0} + """, + true, + """maxItems validation with a decimal -> shorter is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxItems.json`: + * "maxItems validation with a decimal -> too long is invalid" + */ + @Test + fun maxItems_maxItemsValidationWithADecimal_tooLongIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxItems_maxItemsValidationWithADecimal_tooLongIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3] + """, + """ + {"maxItems":2.0} + """, + false, + """maxItems validation with a decimal -> too long is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxLength.json`: + * "maxLength validation -> shorter is valid" + */ + @Test + fun maxLength_maxLengthValidation_shorterIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxLength_maxLengthValidation_shorterIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "f" + """, + """ + {"maxLength":2} + """, + true, + """maxLength validation -> shorter is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxLength.json`: + * "maxLength validation -> exact length is valid" + */ + @Test + fun maxLength_maxLengthValidation_exactLengthIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxLength_maxLengthValidation_exactLengthIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "fo" + """, + """ + {"maxLength":2} + """, + true, + """maxLength validation -> exact length is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxLength.json`: + * "maxLength validation -> too long is invalid" + */ + @Test + fun maxLength_maxLengthValidation_tooLongIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxLength_maxLengthValidation_tooLongIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"maxLength":2} + """, + false, + """maxLength validation -> too long is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxLength.json`: + * "maxLength validation -> ignores non-strings" + */ + @Test + fun maxLength_maxLengthValidation_ignoresNon_strings() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxLength_maxLengthValidation_ignoresNon_strings" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 100 + """, + """ + {"maxLength":2} + """, + true, + """maxLength validation -> ignores non-strings""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxLength.json`: + * "maxLength validation -> two graphemes is long enough" + */ + @Test + fun maxLength_maxLengthValidation_twoGraphemesIsLongEnough() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxLength_maxLengthValidation_twoGraphemesIsLongEnough" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "💩💩" + """, + """ + {"maxLength":2} + """, + true, + """maxLength validation -> two graphemes is long enough""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxLength.json`: + * "maxLength validation with a decimal -> shorter is valid" + */ + @Test + fun maxLength_maxLengthValidationWithADecimal_shorterIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxLength_maxLengthValidationWithADecimal_shorterIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "f" + """, + """ + {"maxLength":2.0} + """, + true, + """maxLength validation with a decimal -> shorter is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxLength.json`: + * "maxLength validation with a decimal -> too long is invalid" + */ + @Test + fun maxLength_maxLengthValidationWithADecimal_tooLongIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxLength_maxLengthValidationWithADecimal_tooLongIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"maxLength":2.0} + """, + false, + """maxLength validation with a decimal -> too long is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxProperties.json`: + * "maxProperties validation -> shorter is valid" + */ + @Test + fun maxProperties_maxPropertiesValidation_shorterIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxProperties_maxPropertiesValidation_shorterIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"maxProperties":2} + """, + true, + """maxProperties validation -> shorter is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxProperties.json`: + * "maxProperties validation -> exact length is valid" + */ + @Test + fun maxProperties_maxPropertiesValidation_exactLengthIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxProperties_maxPropertiesValidation_exactLengthIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2} + """, + """ + {"maxProperties":2} + """, + true, + """maxProperties validation -> exact length is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxProperties.json`: + * "maxProperties validation -> too long is invalid" + */ + @Test + fun maxProperties_maxPropertiesValidation_tooLongIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxProperties_maxPropertiesValidation_tooLongIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2,"baz":3} + """, + """ + {"maxProperties":2} + """, + false, + """maxProperties validation -> too long is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxProperties.json`: + * "maxProperties validation -> ignores arrays" + */ + @Test + fun maxProperties_maxPropertiesValidation_ignoresArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxProperties_maxPropertiesValidation_ignoresArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3] + """, + """ + {"maxProperties":2} + """, + true, + """maxProperties validation -> ignores arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxProperties.json`: + * "maxProperties validation -> ignores strings" + */ + @Test + fun maxProperties_maxPropertiesValidation_ignoresStrings() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxProperties_maxPropertiesValidation_ignoresStrings" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foobar" + """, + """ + {"maxProperties":2} + """, + true, + """maxProperties validation -> ignores strings""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxProperties.json`: + * "maxProperties validation -> ignores other non-objects" + */ + @Test + fun maxProperties_maxPropertiesValidation_ignoresOtherNon_objects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxProperties_maxPropertiesValidation_ignoresOtherNon_objects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"maxProperties":2} + """, + true, + """maxProperties validation -> ignores other non-objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxProperties.json`: + * "maxProperties validation with a decimal -> shorter is valid" + */ + @Test + fun maxProperties_maxPropertiesValidationWithADecimal_shorterIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxProperties_maxPropertiesValidationWithADecimal_shorterIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"maxProperties":2.0} + """, + true, + """maxProperties validation with a decimal -> shorter is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxProperties.json`: + * "maxProperties validation with a decimal -> too long is invalid" + */ + @Test + fun maxProperties_maxPropertiesValidationWithADecimal_tooLongIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxProperties_maxPropertiesValidationWithADecimal_tooLongIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2,"baz":3} + """, + """ + {"maxProperties":2.0} + """, + false, + """maxProperties validation with a decimal -> too long is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxProperties.json`: + * "maxProperties = 0 means the object is empty -> no properties is valid" + */ + @Test + fun maxProperties_maxProperties_0MeansTheObjectIsEmpty_noPropertiesIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxProperties_maxProperties_0MeansTheObjectIsEmpty_noPropertiesIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"maxProperties":0} + """, + true, + """maxProperties = 0 means the object is empty -> no properties is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maxProperties.json`: + * "maxProperties = 0 means the object is empty -> one property is invalid" + */ + @Test + fun maxProperties_maxProperties_0MeansTheObjectIsEmpty_onePropertyIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maxProperties_maxProperties_0MeansTheObjectIsEmpty_onePropertyIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"maxProperties":0} + """, + false, + """maxProperties = 0 means the object is empty -> one property is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maximum.json`: + * "maximum validation -> below the maximum is valid" + */ + @Test + fun maximum_maximumValidation_belowTheMaximumIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maximum_maximumValidation_belowTheMaximumIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 2.6 + """, + """ + {"maximum":3.0} + """, + true, + """maximum validation -> below the maximum is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maximum.json`: + * "maximum validation -> boundary point is valid" + */ + @Test + fun maximum_maximumValidation_boundaryPointIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maximum_maximumValidation_boundaryPointIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3.0 + """, + """ + {"maximum":3.0} + """, + true, + """maximum validation -> boundary point is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maximum.json`: + * "maximum validation -> above the maximum is invalid" + */ + @Test + fun maximum_maximumValidation_aboveTheMaximumIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maximum_maximumValidation_aboveTheMaximumIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3.5 + """, + """ + {"maximum":3.0} + """, + false, + """maximum validation -> above the maximum is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maximum.json`: + * "maximum validation -> ignores non-numbers" + */ + @Test + fun maximum_maximumValidation_ignoresNon_numbers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maximum_maximumValidation_ignoresNon_numbers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "x" + """, + """ + {"maximum":3.0} + """, + true, + """maximum validation -> ignores non-numbers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maximum.json`: + * "maximum validation with unsigned integer -> below the maximum is invalid" + */ + @Test + fun maximum_maximumValidationWithUnsignedInteger_belowTheMaximumIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maximum_maximumValidationWithUnsignedInteger_belowTheMaximumIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 299.97 + """, + """ + {"maximum":300} + """, + true, + """maximum validation with unsigned integer -> below the maximum is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maximum.json`: + * "maximum validation with unsigned integer -> boundary point integer is valid" + */ + @Test + fun maximum_maximumValidationWithUnsignedInteger_boundaryPointIntegerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maximum_maximumValidationWithUnsignedInteger_boundaryPointIntegerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 300 + """, + """ + {"maximum":300} + """, + true, + """maximum validation with unsigned integer -> boundary point integer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maximum.json`: + * "maximum validation with unsigned integer -> boundary point float is valid" + */ + @Test + fun maximum_maximumValidationWithUnsignedInteger_boundaryPointFloatIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maximum_maximumValidationWithUnsignedInteger_boundaryPointFloatIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 300.00 + """, + """ + {"maximum":300} + """, + true, + """maximum validation with unsigned integer -> boundary point float is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/maximum.json`: + * "maximum validation with unsigned integer -> above the maximum is invalid" + */ + @Test + fun maximum_maximumValidationWithUnsignedInteger_aboveTheMaximumIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "maximum_maximumValidationWithUnsignedInteger_aboveTheMaximumIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 300.5 + """, + """ + {"maximum":300} + """, + false, + """maximum validation with unsigned integer -> above the maximum is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minItems.json`: + * "minItems validation -> longer is valid" + */ + @Test + fun minItems_minItemsValidation_longerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minItems_minItemsValidation_longerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2] + """, + """ + {"minItems":1} + """, + true, + """minItems validation -> longer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minItems.json`: + * "minItems validation -> exact length is valid" + */ + @Test + fun minItems_minItemsValidation_exactLengthIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minItems_minItemsValidation_exactLengthIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1] + """, + """ + {"minItems":1} + """, + true, + """minItems validation -> exact length is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minItems.json`: + * "minItems validation -> too short is invalid" + */ + @Test + fun minItems_minItemsValidation_tooShortIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minItems_minItemsValidation_tooShortIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"minItems":1} + """, + false, + """minItems validation -> too short is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minItems.json`: + * "minItems validation -> ignores non-arrays" + */ + @Test + fun minItems_minItemsValidation_ignoresNon_arrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minItems_minItemsValidation_ignoresNon_arrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "" + """, + """ + {"minItems":1} + """, + true, + """minItems validation -> ignores non-arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minItems.json`: + * "minItems validation with a decimal -> longer is valid" + */ + @Test + fun minItems_minItemsValidationWithADecimal_longerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minItems_minItemsValidationWithADecimal_longerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2] + """, + """ + {"minItems":1.0} + """, + true, + """minItems validation with a decimal -> longer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minItems.json`: + * "minItems validation with a decimal -> too short is invalid" + */ + @Test + fun minItems_minItemsValidationWithADecimal_tooShortIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minItems_minItemsValidationWithADecimal_tooShortIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"minItems":1.0} + """, + false, + """minItems validation with a decimal -> too short is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minLength.json`: + * "minLength validation -> longer is valid" + */ + @Test + fun minLength_minLengthValidation_longerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minLength_minLengthValidation_longerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"minLength":2} + """, + true, + """minLength validation -> longer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minLength.json`: + * "minLength validation -> exact length is valid" + */ + @Test + fun minLength_minLengthValidation_exactLengthIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minLength_minLengthValidation_exactLengthIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "fo" + """, + """ + {"minLength":2} + """, + true, + """minLength validation -> exact length is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minLength.json`: + * "minLength validation -> too short is invalid" + */ + @Test + fun minLength_minLengthValidation_tooShortIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minLength_minLengthValidation_tooShortIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "f" + """, + """ + {"minLength":2} + """, + false, + """minLength validation -> too short is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minLength.json`: + * "minLength validation -> ignores non-strings" + */ + @Test + fun minLength_minLengthValidation_ignoresNon_strings() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minLength_minLengthValidation_ignoresNon_strings" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"minLength":2} + """, + true, + """minLength validation -> ignores non-strings""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minLength.json`: + * "minLength validation -> one grapheme is not long enough" + */ + @Test + fun minLength_minLengthValidation_oneGraphemeIsNotLongEnough() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minLength_minLengthValidation_oneGraphemeIsNotLongEnough" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "💩" + """, + """ + {"minLength":2} + """, + false, + """minLength validation -> one grapheme is not long enough""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minLength.json`: + * "minLength validation with a decimal -> longer is valid" + */ + @Test + fun minLength_minLengthValidationWithADecimal_longerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minLength_minLengthValidationWithADecimal_longerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"minLength":2.0} + """, + true, + """minLength validation with a decimal -> longer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minLength.json`: + * "minLength validation with a decimal -> too short is invalid" + */ + @Test + fun minLength_minLengthValidationWithADecimal_tooShortIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minLength_minLengthValidationWithADecimal_tooShortIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "f" + """, + """ + {"minLength":2.0} + """, + false, + """minLength validation with a decimal -> too short is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minProperties.json`: + * "minProperties validation -> longer is valid" + */ + @Test + fun minProperties_minPropertiesValidation_longerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minProperties_minPropertiesValidation_longerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2} + """, + """ + {"minProperties":1} + """, + true, + """minProperties validation -> longer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minProperties.json`: + * "minProperties validation -> exact length is valid" + */ + @Test + fun minProperties_minPropertiesValidation_exactLengthIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minProperties_minPropertiesValidation_exactLengthIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"minProperties":1} + """, + true, + """minProperties validation -> exact length is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minProperties.json`: + * "minProperties validation -> too short is invalid" + */ + @Test + fun minProperties_minPropertiesValidation_tooShortIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minProperties_minPropertiesValidation_tooShortIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"minProperties":1} + """, + false, + """minProperties validation -> too short is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minProperties.json`: + * "minProperties validation -> ignores arrays" + */ + @Test + fun minProperties_minPropertiesValidation_ignoresArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minProperties_minPropertiesValidation_ignoresArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"minProperties":1} + """, + true, + """minProperties validation -> ignores arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minProperties.json`: + * "minProperties validation -> ignores strings" + */ + @Test + fun minProperties_minPropertiesValidation_ignoresStrings() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minProperties_minPropertiesValidation_ignoresStrings" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "" + """, + """ + {"minProperties":1} + """, + true, + """minProperties validation -> ignores strings""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minProperties.json`: + * "minProperties validation -> ignores other non-objects" + */ + @Test + fun minProperties_minPropertiesValidation_ignoresOtherNon_objects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minProperties_minPropertiesValidation_ignoresOtherNon_objects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"minProperties":1} + """, + true, + """minProperties validation -> ignores other non-objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minProperties.json`: + * "minProperties validation with a decimal -> longer is valid" + */ + @Test + fun minProperties_minPropertiesValidationWithADecimal_longerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minProperties_minPropertiesValidationWithADecimal_longerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2} + """, + """ + {"minProperties":1.0} + """, + true, + """minProperties validation with a decimal -> longer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minProperties.json`: + * "minProperties validation with a decimal -> too short is invalid" + */ + @Test + fun minProperties_minPropertiesValidationWithADecimal_tooShortIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minProperties_minPropertiesValidationWithADecimal_tooShortIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"minProperties":1.0} + """, + false, + """minProperties validation with a decimal -> too short is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minimum.json`: + * "minimum validation -> above the minimum is valid" + */ + @Test + fun minimum_minimumValidation_aboveTheMinimumIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minimum_minimumValidation_aboveTheMinimumIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 2.6 + """, + """ + {"minimum":1.1} + """, + true, + """minimum validation -> above the minimum is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minimum.json`: + * "minimum validation -> boundary point is valid" + */ + @Test + fun minimum_minimumValidation_boundaryPointIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minimum_minimumValidation_boundaryPointIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.1 + """, + """ + {"minimum":1.1} + """, + true, + """minimum validation -> boundary point is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minimum.json`: + * "minimum validation -> below the minimum is invalid" + */ + @Test + fun minimum_minimumValidation_belowTheMinimumIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minimum_minimumValidation_belowTheMinimumIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0.6 + """, + """ + {"minimum":1.1} + """, + false, + """minimum validation -> below the minimum is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minimum.json`: + * "minimum validation -> ignores non-numbers" + */ + @Test + fun minimum_minimumValidation_ignoresNon_numbers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minimum_minimumValidation_ignoresNon_numbers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "x" + """, + """ + {"minimum":1.1} + """, + true, + """minimum validation -> ignores non-numbers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minimum.json`: + * "minimum validation with signed integer -> negative above the minimum is valid" + */ + @Test + fun minimum_minimumValidationWithSignedInteger_negativeAboveTheMinimumIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minimum_minimumValidationWithSignedInteger_negativeAboveTheMinimumIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -1 + """, + """ + {"minimum":-2} + """, + true, + """minimum validation with signed integer -> negative above the minimum is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minimum.json`: + * "minimum validation with signed integer -> positive above the minimum is valid" + */ + @Test + fun minimum_minimumValidationWithSignedInteger_positiveAboveTheMinimumIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minimum_minimumValidationWithSignedInteger_positiveAboveTheMinimumIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0 + """, + """ + {"minimum":-2} + """, + true, + """minimum validation with signed integer -> positive above the minimum is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minimum.json`: + * "minimum validation with signed integer -> boundary point is valid" + */ + @Test + fun minimum_minimumValidationWithSignedInteger_boundaryPointIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minimum_minimumValidationWithSignedInteger_boundaryPointIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -2 + """, + """ + {"minimum":-2} + """, + true, + """minimum validation with signed integer -> boundary point is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minimum.json`: + * "minimum validation with signed integer -> boundary point with float is valid" + */ + @Test + fun minimum_minimumValidationWithSignedInteger_boundaryPointWithFloatIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minimum_minimumValidationWithSignedInteger_boundaryPointWithFloatIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -2.0 + """, + """ + {"minimum":-2} + """, + true, + """minimum validation with signed integer -> boundary point with float is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minimum.json`: + * "minimum validation with signed integer -> float below the minimum is invalid" + */ + @Test + fun minimum_minimumValidationWithSignedInteger_floatBelowTheMinimumIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minimum_minimumValidationWithSignedInteger_floatBelowTheMinimumIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -2.0001 + """, + """ + {"minimum":-2} + """, + false, + """minimum validation with signed integer -> float below the minimum is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minimum.json`: + * "minimum validation with signed integer -> int below the minimum is invalid" + */ + @Test + fun minimum_minimumValidationWithSignedInteger_intBelowTheMinimumIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minimum_minimumValidationWithSignedInteger_intBelowTheMinimumIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + -3 + """, + """ + {"minimum":-2} + """, + false, + """minimum validation with signed integer -> int below the minimum is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/minimum.json`: + * "minimum validation with signed integer -> ignores non-numbers" + */ + @Test + fun minimum_minimumValidationWithSignedInteger_ignoresNon_numbers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "minimum_minimumValidationWithSignedInteger_ignoresNon_numbers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "x" + """, + """ + {"minimum":-2} + """, + true, + """minimum validation with signed integer -> ignores non-numbers""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/multipleOf.json`: + * "by int -> int by int" + */ + @Test + fun multipleOf_byInt_intByInt() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "multipleOf_byInt_intByInt" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 10 + """, + """ + {"multipleOf":2} + """, + true, + """by int -> int by int""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/multipleOf.json`: + * "by int -> int by int fail" + */ + @Test + fun multipleOf_byInt_intByIntFail() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "multipleOf_byInt_intByIntFail" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 7 + """, + """ + {"multipleOf":2} + """, + false, + """by int -> int by int fail""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/multipleOf.json`: + * "by int -> ignores non-numbers" + */ + @Test + fun multipleOf_byInt_ignoresNon_numbers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "multipleOf_byInt_ignoresNon_numbers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"multipleOf":2} + """, + true, + """by int -> ignores non-numbers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/multipleOf.json`: + * "by number -> zero is multiple of anything" + */ + @Test + fun multipleOf_byNumber_zeroIsMultipleOfAnything() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "multipleOf_byNumber_zeroIsMultipleOfAnything" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0 + """, + """ + {"multipleOf":1.5} + """, + true, + """by number -> zero is multiple of anything""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/multipleOf.json`: + * "by number -> 4.5 is multiple of 1.5" + */ + @Test + fun multipleOf_byNumber_4_5IsMultipleOf1_5() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "multipleOf_byNumber_4_5IsMultipleOf1_5" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 4.5 + """, + """ + {"multipleOf":1.5} + """, + true, + """by number -> 4.5 is multiple of 1.5""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/multipleOf.json`: + * "by number -> 35 is not multiple of 1.5" + */ + @Test + fun multipleOf_byNumber_35IsNotMultipleOf1_5() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "multipleOf_byNumber_35IsNotMultipleOf1_5" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 35 + """, + """ + {"multipleOf":1.5} + """, + false, + """by number -> 35 is not multiple of 1.5""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/multipleOf.json`: + * "by small number -> 0.0075 is multiple of 0.0001" + */ + @Test + fun multipleOf_bySmallNumber_0_0075IsMultipleOf0_0001() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "multipleOf_bySmallNumber_0_0075IsMultipleOf0_0001" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0.0075 + """, + """ + {"multipleOf":0.0001} + """, + true, + """by small number -> 0.0075 is multiple of 0.0001""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/multipleOf.json`: + * "by small number -> 0.00751 is not multiple of 0.0001" + */ + @Test + fun multipleOf_bySmallNumber_0_00751IsNotMultipleOf0_0001() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "multipleOf_bySmallNumber_0_00751IsNotMultipleOf0_0001" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0.00751 + """, + """ + {"multipleOf":0.0001} + """, + false, + """by small number -> 0.00751 is not multiple of 0.0001""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/multipleOf.json`: + * "float division = inf -> always invalid, but naive implementations may raise an overflow error" + */ + @Test + fun multipleOf_floatDivision_Inf_alwaysInvalid_ButNaiveImplementationsMayRaiseAnOverflowError() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "multipleOf_floatDivision_Inf_alwaysInvalid_ButNaiveImplementationsMayRaiseAnOverflowError" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1e308 + """, + """ + {"type":"integer","multipleOf":0.123456789} + """, + false, + """float division = inf -> always invalid, but naive implementations may raise an overflow error""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/multipleOf.json`: + * "small multiple of large integer -> any integer is a multiple of 1e-8" + */ + @Test + fun multipleOf_smallMultipleOfLargeInteger_anyIntegerIsAMultipleOf1e_8() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "multipleOf_smallMultipleOfLargeInteger_anyIntegerIsAMultipleOf1e_8" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12391239123 + """, + """ + {"type":"integer","multipleOf":1e-8} + """, + true, + """small multiple of large integer -> any integer is a multiple of 1e-8""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "not -> allowed" + */ + @Test + fun not_not_allowed() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_not_allowed" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"not":{"type":"integer"}} + """, + true, + """not -> allowed""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "not -> disallowed" + */ + @Test + fun not_not_disallowed() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_not_disallowed" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"not":{"type":"integer"}} + """, + false, + """not -> disallowed""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "not multiple types -> valid" + */ + @Test + fun not_notMultipleTypes_valid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_notMultipleTypes_valid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"not":{"type":["integer","boolean"]}} + """, + true, + """not multiple types -> valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "not multiple types -> mismatch" + */ + @Test + fun not_notMultipleTypes_mismatch() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_notMultipleTypes_mismatch" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"not":{"type":["integer","boolean"]}} + """, + false, + """not multiple types -> mismatch""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "not multiple types -> other mismatch" + */ + @Test + fun not_notMultipleTypes_otherMismatch() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_notMultipleTypes_otherMismatch" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"not":{"type":["integer","boolean"]}} + """, + false, + """not multiple types -> other mismatch""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "not more complex schema -> match" + */ + @Test + fun not_notMoreComplexSchema_match() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_notMoreComplexSchema_match" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"not":{"type":"object","properties":{"foo":{"type":"string"}}}} + """, + true, + """not more complex schema -> match""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "not more complex schema -> other match" + */ + @Test + fun not_notMoreComplexSchema_otherMatch() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_notMoreComplexSchema_otherMatch" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"not":{"type":"object","properties":{"foo":{"type":"string"}}}} + """, + true, + """not more complex schema -> other match""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "not more complex schema -> mismatch" + */ + @Test + fun not_notMoreComplexSchema_mismatch() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_notMoreComplexSchema_mismatch" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"not":{"type":"object","properties":{"foo":{"type":"string"}}}} + """, + false, + """not more complex schema -> mismatch""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbidden property -> property present" + */ + @Test + fun not_forbiddenProperty_propertyPresent() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbiddenProperty_propertyPresent" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2} + """, + """ + {"properties":{"foo":{"not":{}}}} + """, + false, + """forbidden property -> property present""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbidden property -> property absent" + */ + @Test + fun not_forbiddenProperty_propertyAbsent() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbiddenProperty_propertyAbsent" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":1,"baz":2} + """, + """ + {"properties":{"foo":{"not":{}}}} + """, + true, + """forbidden property -> property absent""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with empty schema -> number is invalid" + */ + @Test + fun not_forbidEverythingWithEmptySchema_numberIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithEmptySchema_numberIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"not":{}} + """, + false, + """forbid everything with empty schema -> number is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with empty schema -> string is invalid" + */ + @Test + fun not_forbidEverythingWithEmptySchema_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithEmptySchema_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"not":{}} + """, + false, + """forbid everything with empty schema -> string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with empty schema -> boolean true is invalid" + */ + @Test + fun not_forbidEverythingWithEmptySchema_booleanTrueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithEmptySchema_booleanTrueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"not":{}} + """, + false, + """forbid everything with empty schema -> boolean true is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with empty schema -> boolean false is invalid" + */ + @Test + fun not_forbidEverythingWithEmptySchema_booleanFalseIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithEmptySchema_booleanFalseIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"not":{}} + """, + false, + """forbid everything with empty schema -> boolean false is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with empty schema -> null is invalid" + */ + @Test + fun not_forbidEverythingWithEmptySchema_nullIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithEmptySchema_nullIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"not":{}} + """, + false, + """forbid everything with empty schema -> null is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with empty schema -> object is invalid" + */ + @Test + fun not_forbidEverythingWithEmptySchema_objectIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithEmptySchema_objectIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"not":{}} + """, + false, + """forbid everything with empty schema -> object is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with empty schema -> empty object is invalid" + */ + @Test + fun not_forbidEverythingWithEmptySchema_emptyObjectIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithEmptySchema_emptyObjectIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"not":{}} + """, + false, + """forbid everything with empty schema -> empty object is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with empty schema -> array is invalid" + */ + @Test + fun not_forbidEverythingWithEmptySchema_arrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithEmptySchema_arrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["foo"] + """, + """ + {"not":{}} + """, + false, + """forbid everything with empty schema -> array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with empty schema -> empty array is invalid" + */ + @Test + fun not_forbidEverythingWithEmptySchema_emptyArrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithEmptySchema_emptyArrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"not":{}} + """, + false, + """forbid everything with empty schema -> empty array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with boolean schema true -> number is invalid" + */ + @Test + fun not_forbidEverythingWithBooleanSchemaTrue_numberIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithBooleanSchemaTrue_numberIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"not":true} + """, + false, + """forbid everything with boolean schema true -> number is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with boolean schema true -> string is invalid" + */ + @Test + fun not_forbidEverythingWithBooleanSchemaTrue_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithBooleanSchemaTrue_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"not":true} + """, + false, + """forbid everything with boolean schema true -> string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with boolean schema true -> boolean true is invalid" + */ + @Test + fun not_forbidEverythingWithBooleanSchemaTrue_booleanTrueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithBooleanSchemaTrue_booleanTrueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"not":true} + """, + false, + """forbid everything with boolean schema true -> boolean true is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with boolean schema true -> boolean false is invalid" + */ + @Test + fun not_forbidEverythingWithBooleanSchemaTrue_booleanFalseIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithBooleanSchemaTrue_booleanFalseIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"not":true} + """, + false, + """forbid everything with boolean schema true -> boolean false is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with boolean schema true -> null is invalid" + */ + @Test + fun not_forbidEverythingWithBooleanSchemaTrue_nullIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithBooleanSchemaTrue_nullIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"not":true} + """, + false, + """forbid everything with boolean schema true -> null is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with boolean schema true -> object is invalid" + */ + @Test + fun not_forbidEverythingWithBooleanSchemaTrue_objectIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithBooleanSchemaTrue_objectIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"not":true} + """, + false, + """forbid everything with boolean schema true -> object is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with boolean schema true -> empty object is invalid" + */ + @Test + fun not_forbidEverythingWithBooleanSchemaTrue_emptyObjectIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithBooleanSchemaTrue_emptyObjectIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"not":true} + """, + false, + """forbid everything with boolean schema true -> empty object is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with boolean schema true -> array is invalid" + */ + @Test + fun not_forbidEverythingWithBooleanSchemaTrue_arrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithBooleanSchemaTrue_arrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["foo"] + """, + """ + {"not":true} + """, + false, + """forbid everything with boolean schema true -> array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "forbid everything with boolean schema true -> empty array is invalid" + */ + @Test + fun not_forbidEverythingWithBooleanSchemaTrue_emptyArrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_forbidEverythingWithBooleanSchemaTrue_emptyArrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"not":true} + """, + false, + """forbid everything with boolean schema true -> empty array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "allow everything with boolean schema false -> number is valid" + */ + @Test + fun not_allowEverythingWithBooleanSchemaFalse_numberIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_allowEverythingWithBooleanSchemaFalse_numberIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"not":false} + """, + true, + """allow everything with boolean schema false -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "allow everything with boolean schema false -> string is valid" + */ + @Test + fun not_allowEverythingWithBooleanSchemaFalse_stringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_allowEverythingWithBooleanSchemaFalse_stringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"not":false} + """, + true, + """allow everything with boolean schema false -> string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "allow everything with boolean schema false -> boolean true is valid" + */ + @Test + fun not_allowEverythingWithBooleanSchemaFalse_booleanTrueIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_allowEverythingWithBooleanSchemaFalse_booleanTrueIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"not":false} + """, + true, + """allow everything with boolean schema false -> boolean true is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "allow everything with boolean schema false -> boolean false is valid" + */ + @Test + fun not_allowEverythingWithBooleanSchemaFalse_booleanFalseIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_allowEverythingWithBooleanSchemaFalse_booleanFalseIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"not":false} + """, + true, + """allow everything with boolean schema false -> boolean false is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "allow everything with boolean schema false -> null is valid" + */ + @Test + fun not_allowEverythingWithBooleanSchemaFalse_nullIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_allowEverythingWithBooleanSchemaFalse_nullIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"not":false} + """, + true, + """allow everything with boolean schema false -> null is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "allow everything with boolean schema false -> object is valid" + */ + @Test + fun not_allowEverythingWithBooleanSchemaFalse_objectIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_allowEverythingWithBooleanSchemaFalse_objectIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"not":false} + """, + true, + """allow everything with boolean schema false -> object is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "allow everything with boolean schema false -> empty object is valid" + */ + @Test + fun not_allowEverythingWithBooleanSchemaFalse_emptyObjectIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_allowEverythingWithBooleanSchemaFalse_emptyObjectIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"not":false} + """, + true, + """allow everything with boolean schema false -> empty object is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "allow everything with boolean schema false -> array is valid" + */ + @Test + fun not_allowEverythingWithBooleanSchemaFalse_arrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_allowEverythingWithBooleanSchemaFalse_arrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["foo"] + """, + """ + {"not":false} + """, + true, + """allow everything with boolean schema false -> array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "allow everything with boolean schema false -> empty array is valid" + */ + @Test + fun not_allowEverythingWithBooleanSchemaFalse_emptyArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_allowEverythingWithBooleanSchemaFalse_emptyArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"not":false} + """, + true, + """allow everything with boolean schema false -> empty array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/not.json`: + * "double negation -> any value is valid" + */ + @Test + fun not_doubleNegation_anyValueIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "not_doubleNegation_anyValueIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"not":{"not":{}}} + """, + true, + """double negation -> any value is valid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf -> first oneOf valid" + */ + @Test + fun oneOf_oneOf_firstOneOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOf_firstOneOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"oneOf":[{"type":"integer"},{"minimum":2}]} + """, + true, + """oneOf -> first oneOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf -> second oneOf valid" + */ + @Test + fun oneOf_oneOf_secondOneOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOf_secondOneOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 2.5 + """, + """ + {"oneOf":[{"type":"integer"},{"minimum":2}]} + """, + true, + """oneOf -> second oneOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf -> both oneOf valid" + */ + @Test + fun oneOf_oneOf_bothOneOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOf_bothOneOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3 + """, + """ + {"oneOf":[{"type":"integer"},{"minimum":2}]} + """, + false, + """oneOf -> both oneOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf -> neither oneOf valid" + */ + @Test + fun oneOf_oneOf_neitherOneOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOf_neitherOneOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.5 + """, + """ + {"oneOf":[{"type":"integer"},{"minimum":2}]} + """, + false, + """oneOf -> neither oneOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with base schema -> mismatch base schema" + */ + @Test + fun oneOf_oneOfWithBaseSchema_mismatchBaseSchema() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithBaseSchema_mismatchBaseSchema" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 3 + """, + """ + {"type":"string","oneOf":[{"minLength":2},{"maxLength":4}]} + """, + false, + """oneOf with base schema -> mismatch base schema""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with base schema -> one oneOf valid" + */ + @Test + fun oneOf_oneOfWithBaseSchema_oneOneOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithBaseSchema_oneOneOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foobar" + """, + """ + {"type":"string","oneOf":[{"minLength":2},{"maxLength":4}]} + """, + true, + """oneOf with base schema -> one oneOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with base schema -> both oneOf valid" + */ + @Test + fun oneOf_oneOfWithBaseSchema_bothOneOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithBaseSchema_bothOneOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":"string","oneOf":[{"minLength":2},{"maxLength":4}]} + """, + false, + """oneOf with base schema -> both oneOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with boolean schemas, all true -> any value is invalid" + */ + @Test + fun oneOf_oneOfWithBooleanSchemas_AllTrue_anyValueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithBooleanSchemas_AllTrue_anyValueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"oneOf":[true,true,true]} + """, + false, + """oneOf with boolean schemas, all true -> any value is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with boolean schemas, one true -> any value is valid" + */ + @Test + fun oneOf_oneOfWithBooleanSchemas_OneTrue_anyValueIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithBooleanSchemas_OneTrue_anyValueIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"oneOf":[true,false,false]} + """, + true, + """oneOf with boolean schemas, one true -> any value is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with boolean schemas, more than one true -> any value is invalid" + */ + @Test + fun oneOf_oneOfWithBooleanSchemas_MoreThanOneTrue_anyValueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithBooleanSchemas_MoreThanOneTrue_anyValueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"oneOf":[true,true,false]} + """, + false, + """oneOf with boolean schemas, more than one true -> any value is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with boolean schemas, all false -> any value is invalid" + */ + @Test + fun oneOf_oneOfWithBooleanSchemas_AllFalse_anyValueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithBooleanSchemas_AllFalse_anyValueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"oneOf":[false,false,false]} + """, + false, + """oneOf with boolean schemas, all false -> any value is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf complex types -> first oneOf valid (complex)" + */ + @Test + fun oneOf_oneOfComplexTypes_firstOneOfValid_complex_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfComplexTypes_firstOneOfValid_complex_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":2} + """, + """ + {"oneOf":[{"properties":{"bar":{"type":"integer"}},"required":["bar"]},{"properties":{"foo":{"type":"string"}},"required":["foo"]}]} + """, + true, + """oneOf complex types -> first oneOf valid (complex)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf complex types -> second oneOf valid (complex)" + */ + @Test + fun oneOf_oneOfComplexTypes_secondOneOfValid_complex_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfComplexTypes_secondOneOfValid_complex_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"baz"} + """, + """ + {"oneOf":[{"properties":{"bar":{"type":"integer"}},"required":["bar"]},{"properties":{"foo":{"type":"string"}},"required":["foo"]}]} + """, + true, + """oneOf complex types -> second oneOf valid (complex)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf complex types -> both oneOf valid (complex)" + */ + @Test + fun oneOf_oneOfComplexTypes_bothOneOfValid_complex_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfComplexTypes_bothOneOfValid_complex_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"baz","bar":2} + """, + """ + {"oneOf":[{"properties":{"bar":{"type":"integer"}},"required":["bar"]},{"properties":{"foo":{"type":"string"}},"required":["foo"]}]} + """, + false, + """oneOf complex types -> both oneOf valid (complex)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf complex types -> neither oneOf valid (complex)" + */ + @Test + fun oneOf_oneOfComplexTypes_neitherOneOfValid_complex_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfComplexTypes_neitherOneOfValid_complex_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":2,"bar":"quux"} + """, + """ + {"oneOf":[{"properties":{"bar":{"type":"integer"}},"required":["bar"]},{"properties":{"foo":{"type":"string"}},"required":["foo"]}]} + """, + false, + """oneOf complex types -> neither oneOf valid (complex)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with empty schema -> one valid - valid" + */ + @Test + fun oneOf_oneOfWithEmptySchema_oneValid_Valid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithEmptySchema_oneValid_Valid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"oneOf":[{"type":"number"},{}]} + """, + true, + """oneOf with empty schema -> one valid - valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with empty schema -> both valid - invalid" + */ + @Test + fun oneOf_oneOfWithEmptySchema_bothValid_Invalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithEmptySchema_bothValid_Invalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 123 + """, + """ + {"oneOf":[{"type":"number"},{}]} + """, + false, + """oneOf with empty schema -> both valid - invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with required -> both invalid - invalid" + */ + @Test + fun oneOf_oneOfWithRequired_bothInvalid_Invalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithRequired_bothInvalid_Invalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":2} + """, + """ + {"type":"object","oneOf":[{"required":["foo","bar"]},{"required":["foo","baz"]}]} + """, + false, + """oneOf with required -> both invalid - invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with required -> first valid - valid" + */ + @Test + fun oneOf_oneOfWithRequired_firstValid_Valid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithRequired_firstValid_Valid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2} + """, + """ + {"type":"object","oneOf":[{"required":["foo","bar"]},{"required":["foo","baz"]}]} + """, + true, + """oneOf with required -> first valid - valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with required -> second valid - valid" + */ + @Test + fun oneOf_oneOfWithRequired_secondValid_Valid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithRequired_secondValid_Valid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"baz":3} + """, + """ + {"type":"object","oneOf":[{"required":["foo","bar"]},{"required":["foo","baz"]}]} + """, + true, + """oneOf with required -> second valid - valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with required -> both valid - invalid" + */ + @Test + fun oneOf_oneOfWithRequired_bothValid_Invalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithRequired_bothValid_Invalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2,"baz":3} + """, + """ + {"type":"object","oneOf":[{"required":["foo","bar"]},{"required":["foo","baz"]}]} + """, + false, + """oneOf with required -> both valid - invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with missing optional property -> first oneOf valid" + */ + @Test + fun oneOf_oneOfWithMissingOptionalProperty_firstOneOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithMissingOptionalProperty_firstOneOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":8} + """, + """ + {"oneOf":[{"properties":{"bar":true,"baz":true},"required":["bar"]},{"properties":{"foo":true},"required":["foo"]}]} + """, + true, + """oneOf with missing optional property -> first oneOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with missing optional property -> second oneOf valid" + */ + @Test + fun oneOf_oneOfWithMissingOptionalProperty_secondOneOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithMissingOptionalProperty_secondOneOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"foo"} + """, + """ + {"oneOf":[{"properties":{"bar":true,"baz":true},"required":["bar"]},{"properties":{"foo":true},"required":["foo"]}]} + """, + true, + """oneOf with missing optional property -> second oneOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with missing optional property -> both oneOf valid" + */ + @Test + fun oneOf_oneOfWithMissingOptionalProperty_bothOneOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithMissingOptionalProperty_bothOneOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"foo","bar":8} + """, + """ + {"oneOf":[{"properties":{"bar":true,"baz":true},"required":["bar"]},{"properties":{"foo":true},"required":["foo"]}]} + """, + false, + """oneOf with missing optional property -> both oneOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "oneOf with missing optional property -> neither oneOf valid" + */ + @Test + fun oneOf_oneOfWithMissingOptionalProperty_neitherOneOfValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_oneOfWithMissingOptionalProperty_neitherOneOfValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"baz":"quux"} + """, + """ + {"oneOf":[{"properties":{"bar":true,"baz":true},"required":["bar"]},{"properties":{"foo":true},"required":["foo"]}]} + """, + false, + """oneOf with missing optional property -> neither oneOf valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "nested oneOf, to check validation semantics -> null is valid" + */ + @Test + fun oneOf_nestedOneOf_ToCheckValidationSemantics_nullIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_nestedOneOf_ToCheckValidationSemantics_nullIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"oneOf":[{"oneOf":[{"type":"null"}]}]} + """, + true, + """nested oneOf, to check validation semantics -> null is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/oneOf.json`: + * "nested oneOf, to check validation semantics -> anything non-null is invalid" + */ + @Test + fun oneOf_nestedOneOf_ToCheckValidationSemantics_anythingNon_nullIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "oneOf_nestedOneOf_ToCheckValidationSemantics_anythingNon_nullIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 123 + """, + """ + {"oneOf":[{"oneOf":[{"type":"null"}]}]} + """, + false, + """nested oneOf, to check validation semantics -> anything non-null is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/pattern.json`: + * "pattern validation -> a matching pattern is valid" + */ + @Test + fun pattern_patternValidation_aMatchingPatternIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "pattern_patternValidation_aMatchingPatternIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "aaa" + """, + """ + {"pattern":"^a*${'$'}"} + """, + true, + """pattern validation -> a matching pattern is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/pattern.json`: + * "pattern validation -> a non-matching pattern is invalid" + */ + @Test + fun pattern_patternValidation_aNon_matchingPatternIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "pattern_patternValidation_aNon_matchingPatternIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "abc" + """, + """ + {"pattern":"^a*${'$'}"} + """, + false, + """pattern validation -> a non-matching pattern is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/pattern.json`: + * "pattern validation -> ignores booleans" + */ + @Test + fun pattern_patternValidation_ignoresBooleans() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "pattern_patternValidation_ignoresBooleans" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"pattern":"^a*${'$'}"} + """, + true, + """pattern validation -> ignores booleans""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/pattern.json`: + * "pattern validation -> ignores integers" + */ + @Test + fun pattern_patternValidation_ignoresIntegers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "pattern_patternValidation_ignoresIntegers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 123 + """, + """ + {"pattern":"^a*${'$'}"} + """, + true, + """pattern validation -> ignores integers""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/pattern.json`: + * "pattern validation -> ignores floats" + */ + @Test + fun pattern_patternValidation_ignoresFloats() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "pattern_patternValidation_ignoresFloats" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.0 + """, + """ + {"pattern":"^a*${'$'}"} + """, + true, + """pattern validation -> ignores floats""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/pattern.json`: + * "pattern validation -> ignores objects" + */ + @Test + fun pattern_patternValidation_ignoresObjects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "pattern_patternValidation_ignoresObjects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"pattern":"^a*${'$'}"} + """, + true, + """pattern validation -> ignores objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/pattern.json`: + * "pattern validation -> ignores arrays" + */ + @Test + fun pattern_patternValidation_ignoresArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "pattern_patternValidation_ignoresArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"pattern":"^a*${'$'}"} + """, + true, + """pattern validation -> ignores arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/pattern.json`: + * "pattern validation -> ignores null" + */ + @Test + fun pattern_patternValidation_ignoresNull() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "pattern_patternValidation_ignoresNull" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"pattern":"^a*${'$'}"} + """, + true, + """pattern validation -> ignores null""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/pattern.json`: + * "pattern is not anchored -> matches a substring" + */ + @Test + fun pattern_patternIsNotAnchored_matchesASubstring() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "pattern_patternIsNotAnchored_matchesASubstring" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "xxaayy" + """, + """ + {"pattern":"a+"} + """, + true, + """pattern is not anchored -> matches a substring""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties validates properties matching a regex -> a single valid match is valid" + */ + @Test + fun patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_aSingleValidMatchIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_aSingleValidMatchIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"patternProperties":{"f.*o":{"type":"integer"}}} + """, + true, + """patternProperties validates properties matching a regex -> a single valid match is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties validates properties matching a regex -> multiple valid matches is valid" + */ + @Test + fun patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_multipleValidMatchesIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_multipleValidMatchesIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"foooooo":2} + """, + """ + {"patternProperties":{"f.*o":{"type":"integer"}}} + """, + true, + """patternProperties validates properties matching a regex -> multiple valid matches is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties validates properties matching a regex -> a single invalid match is invalid" + */ + @Test + fun patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_aSingleInvalidMatchIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_aSingleInvalidMatchIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar","fooooo":2} + """, + """ + {"patternProperties":{"f.*o":{"type":"integer"}}} + """, + false, + """patternProperties validates properties matching a regex -> a single invalid match is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties validates properties matching a regex -> multiple invalid matches is invalid" + */ + @Test + fun patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_multipleInvalidMatchesIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_multipleInvalidMatchesIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar","foooooo":"baz"} + """, + """ + {"patternProperties":{"f.*o":{"type":"integer"}}} + """, + false, + """patternProperties validates properties matching a regex -> multiple invalid matches is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties validates properties matching a regex -> ignores arrays" + */ + @Test + fun patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_ignoresArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_ignoresArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["foo"] + """, + """ + {"patternProperties":{"f.*o":{"type":"integer"}}} + """, + true, + """patternProperties validates properties matching a regex -> ignores arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties validates properties matching a regex -> ignores strings" + */ + @Test + fun patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_ignoresStrings() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_ignoresStrings" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"patternProperties":{"f.*o":{"type":"integer"}}} + """, + true, + """patternProperties validates properties matching a regex -> ignores strings""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties validates properties matching a regex -> ignores other non-objects" + */ + @Test + fun patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_ignoresOtherNon_objects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesValidatesPropertiesMatchingARegex_ignoresOtherNon_objects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"patternProperties":{"f.*o":{"type":"integer"}}} + """, + true, + """patternProperties validates properties matching a regex -> ignores other non-objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "multiple simultaneous patternProperties are validated -> a single valid match is valid" + */ + @Test + fun patternProperties_multipleSimultaneousPatternPropertiesAreValidated_aSingleValidMatchIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_multipleSimultaneousPatternPropertiesAreValidated_aSingleValidMatchIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a":21} + """, + """ + {"patternProperties":{"a*":{"type":"integer"},"aaa*":{"maximum":20}}} + """, + true, + """multiple simultaneous patternProperties are validated -> a single valid match is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "multiple simultaneous patternProperties are validated -> a simultaneous match is valid" + */ + @Test + fun patternProperties_multipleSimultaneousPatternPropertiesAreValidated_aSimultaneousMatchIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_multipleSimultaneousPatternPropertiesAreValidated_aSimultaneousMatchIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"aaaa":18} + """, + """ + {"patternProperties":{"a*":{"type":"integer"},"aaa*":{"maximum":20}}} + """, + true, + """multiple simultaneous patternProperties are validated -> a simultaneous match is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "multiple simultaneous patternProperties are validated -> multiple matches is valid" + */ + @Test + fun patternProperties_multipleSimultaneousPatternPropertiesAreValidated_multipleMatchesIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_multipleSimultaneousPatternPropertiesAreValidated_multipleMatchesIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a":21,"aaaa":18} + """, + """ + {"patternProperties":{"a*":{"type":"integer"},"aaa*":{"maximum":20}}} + """, + true, + """multiple simultaneous patternProperties are validated -> multiple matches is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "multiple simultaneous patternProperties are validated -> an invalid due to one is invalid" + */ + @Test + fun patternProperties_multipleSimultaneousPatternPropertiesAreValidated_anInvalidDueToOneIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_multipleSimultaneousPatternPropertiesAreValidated_anInvalidDueToOneIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a":"bar"} + """, + """ + {"patternProperties":{"a*":{"type":"integer"},"aaa*":{"maximum":20}}} + """, + false, + """multiple simultaneous patternProperties are validated -> an invalid due to one is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "multiple simultaneous patternProperties are validated -> an invalid due to the other is invalid" + */ + @Test + fun patternProperties_multipleSimultaneousPatternPropertiesAreValidated_anInvalidDueToTheOtherIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_multipleSimultaneousPatternPropertiesAreValidated_anInvalidDueToTheOtherIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"aaaa":31} + """, + """ + {"patternProperties":{"a*":{"type":"integer"},"aaa*":{"maximum":20}}} + """, + false, + """multiple simultaneous patternProperties are validated -> an invalid due to the other is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "multiple simultaneous patternProperties are validated -> an invalid due to both is invalid" + */ + @Test + fun patternProperties_multipleSimultaneousPatternPropertiesAreValidated_anInvalidDueToBothIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_multipleSimultaneousPatternPropertiesAreValidated_anInvalidDueToBothIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"aaa":"foo","aaaa":31} + """, + """ + {"patternProperties":{"a*":{"type":"integer"},"aaa*":{"maximum":20}}} + """, + false, + """multiple simultaneous patternProperties are validated -> an invalid due to both is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "regexes are not anchored by default and are case sensitive -> non recognized members are ignored" + */ + @Test + fun patternProperties_regexesAreNotAnchoredByDefaultAndAreCaseSensitive_nonRecognizedMembersAreIgnored() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_regexesAreNotAnchoredByDefaultAndAreCaseSensitive_nonRecognizedMembersAreIgnored" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"answer 1":"42"} + """, + """ + {"patternProperties":{"[0-9]{2,}":{"type":"boolean"},"X_":{"type":"string"}}} + """, + true, + """regexes are not anchored by default and are case sensitive -> non recognized members are ignored""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "regexes are not anchored by default and are case sensitive -> recognized members are accounted for" + */ + @Test + fun patternProperties_regexesAreNotAnchoredByDefaultAndAreCaseSensitive_recognizedMembersAreAccountedFor() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_regexesAreNotAnchoredByDefaultAndAreCaseSensitive_recognizedMembersAreAccountedFor" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a31b":null} + """, + """ + {"patternProperties":{"[0-9]{2,}":{"type":"boolean"},"X_":{"type":"string"}}} + """, + false, + """regexes are not anchored by default and are case sensitive -> recognized members are accounted for""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "regexes are not anchored by default and are case sensitive -> regexes are case sensitive" + */ + @Test + fun patternProperties_regexesAreNotAnchoredByDefaultAndAreCaseSensitive_regexesAreCaseSensitive() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_regexesAreNotAnchoredByDefaultAndAreCaseSensitive_regexesAreCaseSensitive" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a_x_3":3} + """, + """ + {"patternProperties":{"[0-9]{2,}":{"type":"boolean"},"X_":{"type":"string"}}} + """, + true, + """regexes are not anchored by default and are case sensitive -> regexes are case sensitive""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "regexes are not anchored by default and are case sensitive -> regexes are case sensitive, 2" + */ + @Test + fun patternProperties_regexesAreNotAnchoredByDefaultAndAreCaseSensitive_regexesAreCaseSensitive_2() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_regexesAreNotAnchoredByDefaultAndAreCaseSensitive_regexesAreCaseSensitive_2" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a_X_3":3} + """, + """ + {"patternProperties":{"[0-9]{2,}":{"type":"boolean"},"X_":{"type":"string"}}} + """, + false, + """regexes are not anchored by default and are case sensitive -> regexes are case sensitive, 2""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties with boolean schemas -> object with property matching schema true is valid" + */ + @Test + fun patternProperties_patternPropertiesWithBooleanSchemas_objectWithPropertyMatchingSchemaTrueIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesWithBooleanSchemas_objectWithPropertyMatchingSchemaTrueIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"patternProperties":{"f.*":true,"b.*":false}} + """, + true, + """patternProperties with boolean schemas -> object with property matching schema true is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties with boolean schemas -> object with property matching schema false is invalid" + */ + @Test + fun patternProperties_patternPropertiesWithBooleanSchemas_objectWithPropertyMatchingSchemaFalseIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesWithBooleanSchemas_objectWithPropertyMatchingSchemaFalseIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":2} + """, + """ + {"patternProperties":{"f.*":true,"b.*":false}} + """, + false, + """patternProperties with boolean schemas -> object with property matching schema false is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties with boolean schemas -> object with both properties is invalid" + */ + @Test + fun patternProperties_patternPropertiesWithBooleanSchemas_objectWithBothPropertiesIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesWithBooleanSchemas_objectWithBothPropertiesIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2} + """, + """ + {"patternProperties":{"f.*":true,"b.*":false}} + """, + false, + """patternProperties with boolean schemas -> object with both properties is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties with boolean schemas -> object with a property matching both true and false is invalid" + */ + @Test + fun patternProperties_patternPropertiesWithBooleanSchemas_objectWithAPropertyMatchingBothTrueAndFalseIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesWithBooleanSchemas_objectWithAPropertyMatchingBothTrueAndFalseIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foobar":1} + """, + """ + {"patternProperties":{"f.*":true,"b.*":false}} + """, + false, + """patternProperties with boolean schemas -> object with a property matching both true and false is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties with boolean schemas -> empty object is valid" + */ + @Test + fun patternProperties_patternPropertiesWithBooleanSchemas_emptyObjectIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesWithBooleanSchemas_emptyObjectIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"patternProperties":{"f.*":true,"b.*":false}} + """, + true, + """patternProperties with boolean schemas -> empty object is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/patternProperties.json`: + * "patternProperties with null valued instance properties -> allows null values" + */ + @Test + fun patternProperties_patternPropertiesWithNullValuedInstanceProperties_allowsNullValues() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "patternProperties_patternPropertiesWithNullValuedInstanceProperties_allowsNullValues" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foobar":null} + """, + """ + {"patternProperties":{"^.*bar${'$'}":{"type":"null"}}} + """, + true, + """patternProperties with null valued instance properties -> allows null values""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "object properties validation -> both properties present and valid is valid" + */ + @Test + fun properties_objectPropertiesValidation_bothPropertiesPresentAndValidIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_objectPropertiesValidation_bothPropertiesPresentAndValidIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":"baz"} + """, + """ + {"properties":{"foo":{"type":"integer"},"bar":{"type":"string"}}} + """, + true, + """object properties validation -> both properties present and valid is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "object properties validation -> one property invalid is invalid" + */ + @Test + fun properties_objectPropertiesValidation_onePropertyInvalidIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_objectPropertiesValidation_onePropertyInvalidIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":{}} + """, + """ + {"properties":{"foo":{"type":"integer"},"bar":{"type":"string"}}} + """, + false, + """object properties validation -> one property invalid is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "object properties validation -> both properties invalid is invalid" + */ + @Test + fun properties_objectPropertiesValidation_bothPropertiesInvalidIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_objectPropertiesValidation_bothPropertiesInvalidIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":[],"bar":{}} + """, + """ + {"properties":{"foo":{"type":"integer"},"bar":{"type":"string"}}} + """, + false, + """object properties validation -> both properties invalid is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "object properties validation -> doesn't invalidate other properties" + */ + @Test + fun properties_objectPropertiesValidation_doesn_tInvalidateOtherProperties() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_objectPropertiesValidation_doesn_tInvalidateOtherProperties" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"quux":[]} + """, + """ + {"properties":{"foo":{"type":"integer"},"bar":{"type":"string"}}} + """, + true, + """object properties validation -> doesn't invalidate other properties""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "object properties validation -> ignores arrays" + */ + @Test + fun properties_objectPropertiesValidation_ignoresArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_objectPropertiesValidation_ignoresArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"properties":{"foo":{"type":"integer"},"bar":{"type":"string"}}} + """, + true, + """object properties validation -> ignores arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "object properties validation -> ignores other non-objects" + */ + @Test + fun properties_objectPropertiesValidation_ignoresOtherNon_objects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_objectPropertiesValidation_ignoresOtherNon_objects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"properties":{"foo":{"type":"integer"},"bar":{"type":"string"}}} + """, + true, + """object properties validation -> ignores other non-objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties, patternProperties, additionalProperties interaction -> property validates property" + */ + @Test + fun properties_properties_PatternProperties_AdditionalPropertiesInteraction_propertyValidatesProperty() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_properties_PatternProperties_AdditionalPropertiesInteraction_propertyValidatesProperty" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":[1,2]} + """, + """ + {"properties":{"foo":{"type":"array","maxItems":3},"bar":{"type":"array"}},"patternProperties":{"f.o":{"minItems":2}},"additionalProperties":{"type":"integer"}} + """, + true, + """properties, patternProperties, additionalProperties interaction -> property validates property""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties, patternProperties, additionalProperties interaction -> property invalidates property" + */ + @Test + fun properties_properties_PatternProperties_AdditionalPropertiesInteraction_propertyInvalidatesProperty() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_properties_PatternProperties_AdditionalPropertiesInteraction_propertyInvalidatesProperty" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":[1,2,3,4]} + """, + """ + {"properties":{"foo":{"type":"array","maxItems":3},"bar":{"type":"array"}},"patternProperties":{"f.o":{"minItems":2}},"additionalProperties":{"type":"integer"}} + """, + false, + """properties, patternProperties, additionalProperties interaction -> property invalidates property""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties, patternProperties, additionalProperties interaction -> patternProperty invalidates property" + */ + @Test + fun properties_properties_PatternProperties_AdditionalPropertiesInteraction_patternPropertyInvalidatesProperty() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_properties_PatternProperties_AdditionalPropertiesInteraction_patternPropertyInvalidatesProperty" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":[]} + """, + """ + {"properties":{"foo":{"type":"array","maxItems":3},"bar":{"type":"array"}},"patternProperties":{"f.o":{"minItems":2}},"additionalProperties":{"type":"integer"}} + """, + false, + """properties, patternProperties, additionalProperties interaction -> patternProperty invalidates property""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties, patternProperties, additionalProperties interaction -> patternProperty validates nonproperty" + */ + @Test + fun properties_properties_PatternProperties_AdditionalPropertiesInteraction_patternPropertyValidatesNonproperty() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_properties_PatternProperties_AdditionalPropertiesInteraction_patternPropertyValidatesNonproperty" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"fxo":[1,2]} + """, + """ + {"properties":{"foo":{"type":"array","maxItems":3},"bar":{"type":"array"}},"patternProperties":{"f.o":{"minItems":2}},"additionalProperties":{"type":"integer"}} + """, + true, + """properties, patternProperties, additionalProperties interaction -> patternProperty validates nonproperty""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties, patternProperties, additionalProperties interaction -> patternProperty invalidates nonproperty" + */ + @Test + fun properties_properties_PatternProperties_AdditionalPropertiesInteraction_patternPropertyInvalidatesNonproperty() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_properties_PatternProperties_AdditionalPropertiesInteraction_patternPropertyInvalidatesNonproperty" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"fxo":[]} + """, + """ + {"properties":{"foo":{"type":"array","maxItems":3},"bar":{"type":"array"}},"patternProperties":{"f.o":{"minItems":2}},"additionalProperties":{"type":"integer"}} + """, + false, + """properties, patternProperties, additionalProperties interaction -> patternProperty invalidates nonproperty""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties, patternProperties, additionalProperties interaction -> additionalProperty ignores property" + */ + @Test + fun properties_properties_PatternProperties_AdditionalPropertiesInteraction_additionalPropertyIgnoresProperty() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_properties_PatternProperties_AdditionalPropertiesInteraction_additionalPropertyIgnoresProperty" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":[]} + """, + """ + {"properties":{"foo":{"type":"array","maxItems":3},"bar":{"type":"array"}},"patternProperties":{"f.o":{"minItems":2}},"additionalProperties":{"type":"integer"}} + """, + true, + """properties, patternProperties, additionalProperties interaction -> additionalProperty ignores property""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties, patternProperties, additionalProperties interaction -> additionalProperty validates others" + */ + @Test + fun properties_properties_PatternProperties_AdditionalPropertiesInteraction_additionalPropertyValidatesOthers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_properties_PatternProperties_AdditionalPropertiesInteraction_additionalPropertyValidatesOthers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"quux":3} + """, + """ + {"properties":{"foo":{"type":"array","maxItems":3},"bar":{"type":"array"}},"patternProperties":{"f.o":{"minItems":2}},"additionalProperties":{"type":"integer"}} + """, + true, + """properties, patternProperties, additionalProperties interaction -> additionalProperty validates others""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties, patternProperties, additionalProperties interaction -> additionalProperty invalidates others" + */ + @Test + fun properties_properties_PatternProperties_AdditionalPropertiesInteraction_additionalPropertyInvalidatesOthers() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_properties_PatternProperties_AdditionalPropertiesInteraction_additionalPropertyInvalidatesOthers" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"quux":"foo"} + """, + """ + {"properties":{"foo":{"type":"array","maxItems":3},"bar":{"type":"array"}},"patternProperties":{"f.o":{"minItems":2}},"additionalProperties":{"type":"integer"}} + """, + false, + """properties, patternProperties, additionalProperties interaction -> additionalProperty invalidates others""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties with boolean schema -> no property present is valid" + */ + @Test + fun properties_propertiesWithBooleanSchema_noPropertyPresentIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWithBooleanSchema_noPropertyPresentIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"properties":{"foo":true,"bar":false}} + """, + true, + """properties with boolean schema -> no property present is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties with boolean schema -> only 'true' property present is valid" + */ + @Test + fun properties_propertiesWithBooleanSchema_only_true_PropertyPresentIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWithBooleanSchema_only_true_PropertyPresentIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"properties":{"foo":true,"bar":false}} + """, + true, + """properties with boolean schema -> only 'true' property present is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties with boolean schema -> only 'false' property present is invalid" + */ + @Test + fun properties_propertiesWithBooleanSchema_only_false_PropertyPresentIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWithBooleanSchema_only_false_PropertyPresentIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":2} + """, + """ + {"properties":{"foo":true,"bar":false}} + """, + false, + """properties with boolean schema -> only 'false' property present is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties with boolean schema -> both properties present is invalid" + */ + @Test + fun properties_propertiesWithBooleanSchema_bothPropertiesPresentIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWithBooleanSchema_bothPropertiesPresentIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1,"bar":2} + """, + """ + {"properties":{"foo":true,"bar":false}} + """, + false, + """properties with boolean schema -> both properties present is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties with escaped characters -> object with all numbers is valid" + */ + @Test + fun properties_propertiesWithEscapedCharacters_objectWithAllNumbersIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWithEscapedCharacters_objectWithAllNumbersIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo\nbar":1,"foo\"bar":1,"foo\\bar":1,"foo\rbar":1,"foo\tbar":1,"foo\fbar":1} + """, + """ + {"properties":{"foo\nbar":{"type":"number"},"foo\"bar":{"type":"number"},"foo\\bar":{"type":"number"},"foo\rbar":{"type":"number"},"foo\tbar":{"type":"number"},"foo\fbar":{"type":"number"}}} + """, + true, + """properties with escaped characters -> object with all numbers is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties with escaped characters -> object with strings is invalid" + */ + @Test + fun properties_propertiesWithEscapedCharacters_objectWithStringsIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWithEscapedCharacters_objectWithStringsIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo\nbar":"1","foo\"bar":"1","foo\\bar":"1","foo\rbar":"1","foo\tbar":"1","foo\fbar":"1"} + """, + """ + {"properties":{"foo\nbar":{"type":"number"},"foo\"bar":{"type":"number"},"foo\\bar":{"type":"number"},"foo\rbar":{"type":"number"},"foo\tbar":{"type":"number"},"foo\fbar":{"type":"number"}}} + """, + false, + """properties with escaped characters -> object with strings is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties with null valued instance properties -> allows null values" + */ + @Test + fun properties_propertiesWithNullValuedInstanceProperties_allowsNullValues() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWithNullValuedInstanceProperties_allowsNullValues" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":null} + """, + """ + {"properties":{"foo":{"type":"null"}}} + """, + true, + """properties with null valued instance properties -> allows null values""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties whose names are Javascript object property names -> ignores arrays" + */ + @Test + fun properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_ignoresArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_ignoresArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"properties":{"__proto__":{"type":"number"},"toString":{"properties":{"length":{"type":"string"}}},"constructor":{"type":"number"}}} + """, + true, + """properties whose names are Javascript object property names -> ignores arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties whose names are Javascript object property names -> ignores other non-objects" + */ + @Test + fun properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_ignoresOtherNon_objects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_ignoresOtherNon_objects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"properties":{"__proto__":{"type":"number"},"toString":{"properties":{"length":{"type":"string"}}},"constructor":{"type":"number"}}} + """, + true, + """properties whose names are Javascript object property names -> ignores other non-objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties whose names are Javascript object property names -> none of the properties mentioned" + */ + @Test + fun properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_noneOfThePropertiesMentioned() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_noneOfThePropertiesMentioned" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"properties":{"__proto__":{"type":"number"},"toString":{"properties":{"length":{"type":"string"}}},"constructor":{"type":"number"}}} + """, + true, + """properties whose names are Javascript object property names -> none of the properties mentioned""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties whose names are Javascript object property names -> __proto__ not valid" + */ + @Test + fun properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames___proto__NotValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames___proto__NotValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"__proto__":"foo"} + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"properties":{"__proto__":{"type":"number"},"toString":{"properties":{"length":{"type":"string"}}},"constructor":{"type":"number"}}} + """, + false, + """properties whose names are Javascript object property names -> __proto__ not valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties whose names are Javascript object property names -> toString not valid" + */ + @Test + fun properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_toStringNotValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_toStringNotValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"toString":{"length":37}} + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"properties":{"__proto__":{"type":"number"},"toString":{"properties":{"length":{"type":"string"}}},"constructor":{"type":"number"}}} + """, + false, + """properties whose names are Javascript object property names -> toString not valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties whose names are Javascript object property names -> constructor not valid" + */ + @Test + fun properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_constructorNotValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_constructorNotValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"constructor":{"length":37}} + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"properties":{"__proto__":{"type":"number"},"toString":{"properties":{"length":{"type":"string"}}},"constructor":{"type":"number"}}} + """, + false, + """properties whose names are Javascript object property names -> constructor not valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/properties.json`: + * "properties whose names are Javascript object property names -> all present and valid" + */ + @Test + fun properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_allPresentAndValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "properties_propertiesWhoseNamesAreJavascriptObjectPropertyNames_allPresentAndValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"__proto__":12,"toString":{"length":"foo"},"constructor":37} + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"properties":{"__proto__":{"type":"number"},"toString":{"properties":{"length":{"type":"string"}}},"constructor":{"type":"number"}}} + """, + true, + """properties whose names are Javascript object property names -> all present and valid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames validation -> all property names valid" + */ + @Test + fun propertyNames_propertyNamesValidation_allPropertyNamesValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesValidation_allPropertyNamesValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"f":{},"foo":{}} + """, + """ + {"propertyNames":{"maxLength":3}} + """, + true, + """propertyNames validation -> all property names valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames validation -> some property names invalid" + */ + @Test + fun propertyNames_propertyNamesValidation_somePropertyNamesInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesValidation_somePropertyNamesInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":{},"foobar":{}} + """, + """ + {"propertyNames":{"maxLength":3}} + """, + false, + """propertyNames validation -> some property names invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames validation -> object without properties is valid" + */ + @Test + fun propertyNames_propertyNamesValidation_objectWithoutPropertiesIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesValidation_objectWithoutPropertiesIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"propertyNames":{"maxLength":3}} + """, + true, + """propertyNames validation -> object without properties is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames validation -> ignores arrays" + */ + @Test + fun propertyNames_propertyNamesValidation_ignoresArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesValidation_ignoresArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3,4] + """, + """ + {"propertyNames":{"maxLength":3}} + """, + true, + """propertyNames validation -> ignores arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames validation -> ignores strings" + */ + @Test + fun propertyNames_propertyNamesValidation_ignoresStrings() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesValidation_ignoresStrings" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foobar" + """, + """ + {"propertyNames":{"maxLength":3}} + """, + true, + """propertyNames validation -> ignores strings""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames validation -> ignores other non-objects" + */ + @Test + fun propertyNames_propertyNamesValidation_ignoresOtherNon_objects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesValidation_ignoresOtherNon_objects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"propertyNames":{"maxLength":3}} + """, + true, + """propertyNames validation -> ignores other non-objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames validation with pattern -> matching property names valid" + */ + @Test + fun propertyNames_propertyNamesValidationWithPattern_matchingPropertyNamesValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesValidationWithPattern_matchingPropertyNamesValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"a":{},"aa":{},"aaa":{}} + """, + """ + {"propertyNames":{"pattern":"^a+${'$'}"}} + """, + true, + """propertyNames validation with pattern -> matching property names valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames validation with pattern -> non-matching property name is invalid" + */ + @Test + fun propertyNames_propertyNamesValidationWithPattern_non_matchingPropertyNameIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesValidationWithPattern_non_matchingPropertyNameIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"aaA":{}} + """, + """ + {"propertyNames":{"pattern":"^a+${'$'}"}} + """, + false, + """propertyNames validation with pattern -> non-matching property name is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames validation with pattern -> object without properties is valid" + */ + @Test + fun propertyNames_propertyNamesValidationWithPattern_objectWithoutPropertiesIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesValidationWithPattern_objectWithoutPropertiesIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"propertyNames":{"pattern":"^a+${'$'}"}} + """, + true, + """propertyNames validation with pattern -> object without properties is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames with boolean schema true -> object with any properties is valid" + */ + @Test + fun propertyNames_propertyNamesWithBooleanSchemaTrue_objectWithAnyPropertiesIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesWithBooleanSchemaTrue_objectWithAnyPropertiesIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"propertyNames":true} + """, + true, + """propertyNames with boolean schema true -> object with any properties is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames with boolean schema true -> empty object is valid" + */ + @Test + fun propertyNames_propertyNamesWithBooleanSchemaTrue_emptyObjectIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesWithBooleanSchemaTrue_emptyObjectIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"propertyNames":true} + """, + true, + """propertyNames with boolean schema true -> empty object is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames with boolean schema false -> object with any properties is invalid" + */ + @Test + fun propertyNames_propertyNamesWithBooleanSchemaFalse_objectWithAnyPropertiesIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesWithBooleanSchemaFalse_objectWithAnyPropertiesIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"propertyNames":false} + """, + false, + """propertyNames with boolean schema false -> object with any properties is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/propertyNames.json`: + * "propertyNames with boolean schema false -> empty object is valid" + */ + @Test + fun propertyNames_propertyNamesWithBooleanSchemaFalse_emptyObjectIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "propertyNames_propertyNamesWithBooleanSchemaFalse_emptyObjectIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"propertyNames":false} + """, + true, + """propertyNames with boolean schema false -> empty object is valid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "root pointer ref -> match" + */ + @Test + fun ref_rootPointerRef_match() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_rootPointerRef_match" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":false} + """, + """ + {"properties":{"foo":{"${'$'}ref":"#"}},"additionalProperties":false} + """, + true, + """root pointer ref -> match""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "root pointer ref -> recursive match" + */ + @Test + fun ref_rootPointerRef_recursiveMatch() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_rootPointerRef_recursiveMatch" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":{"foo":false}} + """, + """ + {"properties":{"foo":{"${'$'}ref":"#"}},"additionalProperties":false} + """, + true, + """root pointer ref -> recursive match""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "root pointer ref -> mismatch" + */ + @Test + fun ref_rootPointerRef_mismatch() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_rootPointerRef_mismatch" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":false} + """, + """ + {"properties":{"foo":{"${'$'}ref":"#"}},"additionalProperties":false} + """, + false, + """root pointer ref -> mismatch""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "root pointer ref -> recursive mismatch" + */ + @Test + fun ref_rootPointerRef_recursiveMismatch() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_rootPointerRef_recursiveMismatch" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":{"bar":false}} + """, + """ + {"properties":{"foo":{"${'$'}ref":"#"}},"additionalProperties":false} + """, + false, + """root pointer ref -> recursive mismatch""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "relative pointer ref to object -> match" + */ + @Test + fun ref_relativePointerRefToObject_match() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_relativePointerRefToObject_match" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":3} + """, + """ + {"properties":{"foo":{"type":"integer"},"bar":{"${'$'}ref":"#/properties/foo"}}} + """, + true, + """relative pointer ref to object -> match""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "relative pointer ref to object -> mismatch" + */ + @Test + fun ref_relativePointerRefToObject_mismatch() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_relativePointerRefToObject_mismatch" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":true} + """, + """ + {"properties":{"foo":{"type":"integer"},"bar":{"${'$'}ref":"#/properties/foo"}}} + """, + false, + """relative pointer ref to object -> mismatch""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "relative pointer ref to array -> match array" + */ + @Test + fun ref_relativePointerRefToArray_matchArray() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_relativePointerRefToArray_matchArray" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2] + """, + """ + {"items":[{"type":"integer"},{"${'$'}ref":"#/items/0"}]} + """, + true, + """relative pointer ref to array -> match array""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "relative pointer ref to array -> mismatch array" + */ + @Test + fun ref_relativePointerRefToArray_mismatchArray() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_relativePointerRefToArray_mismatchArray" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,"foo"] + """, + """ + {"items":[{"type":"integer"},{"${'$'}ref":"#/items/0"}]} + """, + false, + """relative pointer ref to array -> mismatch array""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "escaped pointer ref -> slash invalid" + */ + @Test + fun ref_escapedPointerRef_slashInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_escapedPointerRef_slashInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"slash":"aoeu"} + """, + """ + {"definitions":{"tilde~field":{"type":"integer"},"slash/field":{"type":"integer"},"percent%field":{"type":"integer"}},"properties":{"tilde":{"${'$'}ref":"#/definitions/tilde~0field"},"slash":{"${'$'}ref":"#/definitions/slash~1field"},"percent":{"${'$'}ref":"#/definitions/percent%25field"}}} + """, + false, + """escaped pointer ref -> slash invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "escaped pointer ref -> tilde invalid" + */ + @Test + fun ref_escapedPointerRef_tildeInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_escapedPointerRef_tildeInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"tilde":"aoeu"} + """, + """ + {"definitions":{"tilde~field":{"type":"integer"},"slash/field":{"type":"integer"},"percent%field":{"type":"integer"}},"properties":{"tilde":{"${'$'}ref":"#/definitions/tilde~0field"},"slash":{"${'$'}ref":"#/definitions/slash~1field"},"percent":{"${'$'}ref":"#/definitions/percent%25field"}}} + """, + false, + """escaped pointer ref -> tilde invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "escaped pointer ref -> percent invalid" + */ + @Test + fun ref_escapedPointerRef_percentInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_escapedPointerRef_percentInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"percent":"aoeu"} + """, + """ + {"definitions":{"tilde~field":{"type":"integer"},"slash/field":{"type":"integer"},"percent%field":{"type":"integer"}},"properties":{"tilde":{"${'$'}ref":"#/definitions/tilde~0field"},"slash":{"${'$'}ref":"#/definitions/slash~1field"},"percent":{"${'$'}ref":"#/definitions/percent%25field"}}} + """, + false, + """escaped pointer ref -> percent invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "escaped pointer ref -> slash valid" + */ + @Test + fun ref_escapedPointerRef_slashValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_escapedPointerRef_slashValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"slash":123} + """, + """ + {"definitions":{"tilde~field":{"type":"integer"},"slash/field":{"type":"integer"},"percent%field":{"type":"integer"}},"properties":{"tilde":{"${'$'}ref":"#/definitions/tilde~0field"},"slash":{"${'$'}ref":"#/definitions/slash~1field"},"percent":{"${'$'}ref":"#/definitions/percent%25field"}}} + """, + true, + """escaped pointer ref -> slash valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "escaped pointer ref -> tilde valid" + */ + @Test + fun ref_escapedPointerRef_tildeValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_escapedPointerRef_tildeValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"tilde":123} + """, + """ + {"definitions":{"tilde~field":{"type":"integer"},"slash/field":{"type":"integer"},"percent%field":{"type":"integer"}},"properties":{"tilde":{"${'$'}ref":"#/definitions/tilde~0field"},"slash":{"${'$'}ref":"#/definitions/slash~1field"},"percent":{"${'$'}ref":"#/definitions/percent%25field"}}} + """, + true, + """escaped pointer ref -> tilde valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "escaped pointer ref -> percent valid" + */ + @Test + fun ref_escapedPointerRef_percentValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_escapedPointerRef_percentValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"percent":123} + """, + """ + {"definitions":{"tilde~field":{"type":"integer"},"slash/field":{"type":"integer"},"percent%field":{"type":"integer"}},"properties":{"tilde":{"${'$'}ref":"#/definitions/tilde~0field"},"slash":{"${'$'}ref":"#/definitions/slash~1field"},"percent":{"${'$'}ref":"#/definitions/percent%25field"}}} + """, + true, + """escaped pointer ref -> percent valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "nested refs -> nested ref valid" + */ + @Test + fun ref_nestedRefs_nestedRefValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_nestedRefs_nestedRefValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 5 + """, + """ + {"definitions":{"a":{"type":"integer"},"b":{"${'$'}ref":"#/definitions/a"},"c":{"${'$'}ref":"#/definitions/b"}},"allOf":[{"${'$'}ref":"#/definitions/c"}]} + """, + true, + """nested refs -> nested ref valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "nested refs -> nested ref invalid" + */ + @Test + fun ref_nestedRefs_nestedRefInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_nestedRefs_nestedRefInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"definitions":{"a":{"type":"integer"},"b":{"${'$'}ref":"#/definitions/a"},"c":{"${'$'}ref":"#/definitions/b"}},"allOf":[{"${'$'}ref":"#/definitions/c"}]} + """, + false, + """nested refs -> nested ref invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "ref overrides any sibling keywords -> ref valid" + */ + @Test + fun ref_refOverridesAnySiblingKeywords_refValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refOverridesAnySiblingKeywords_refValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":[]} + """, + """ + {"definitions":{"reffed":{"type":"array"}},"properties":{"foo":{"${'$'}ref":"#/definitions/reffed","maxItems":2}}} + """, + true, + """ref overrides any sibling keywords -> ref valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "ref overrides any sibling keywords -> ref valid, maxItems ignored" + */ + @Test + fun ref_refOverridesAnySiblingKeywords_refValid_MaxItemsIgnored() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refOverridesAnySiblingKeywords_refValid_MaxItemsIgnored" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":[1,2,3]} + """, + """ + {"definitions":{"reffed":{"type":"array"}},"properties":{"foo":{"${'$'}ref":"#/definitions/reffed","maxItems":2}}} + """, + true, + """ref overrides any sibling keywords -> ref valid, maxItems ignored""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "ref overrides any sibling keywords -> ref invalid" + */ + @Test + fun ref_refOverridesAnySiblingKeywords_refInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refOverridesAnySiblingKeywords_refInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"string"} + """, + """ + {"definitions":{"reffed":{"type":"array"}},"properties":{"foo":{"${'$'}ref":"#/definitions/reffed","maxItems":2}}} + """, + false, + """ref overrides any sibling keywords -> ref invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "$ref prevents a sibling $id from changing the base uri -> $ref resolves to /definitions/base_foo, data does not validate" + */ + @Test + fun ref_______refPreventsASibling______idFromChangingTheBaseUri_______refResolvesTo_definitions_base_foo_DataDoesNotValidate() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_______refPreventsASibling______idFromChangingTheBaseUri_______refResolvesTo_definitions_base_foo_DataDoesNotValidate" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"${'$'}id":"http://localhost:1234/sibling_id/base/","definitions":{"foo":{"${'$'}id":"http://localhost:1234/sibling_id/foo.json","type":"string"},"base_foo":{"${'$'}comment":"this canonical uri is http://localhost:1234/sibling_id/base/foo.json","${'$'}id":"foo.json","type":"number"}},"allOf":[{"${'$'}comment":"${'$'}ref resolves to http://localhost:1234/sibling_id/base/foo.json, not http://localhost:1234/sibling_id/foo.json","${'$'}id":"http://localhost:1234/sibling_id/","${'$'}ref":"foo.json"}]} + """, + false, + """${'$'}ref prevents a sibling ${'$'}id from changing the base uri -> ${'$'}ref resolves to /definitions/base_foo, data does not validate""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "$ref prevents a sibling $id from changing the base uri -> $ref resolves to /definitions/base_foo, data validates" + */ + @Test + fun ref_______refPreventsASibling______idFromChangingTheBaseUri_______refResolvesTo_definitions_base_foo_DataValidates() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_______refPreventsASibling______idFromChangingTheBaseUri_______refResolvesTo_definitions_base_foo_DataValidates" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"${'$'}id":"http://localhost:1234/sibling_id/base/","definitions":{"foo":{"${'$'}id":"http://localhost:1234/sibling_id/foo.json","type":"string"},"base_foo":{"${'$'}comment":"this canonical uri is http://localhost:1234/sibling_id/base/foo.json","${'$'}id":"foo.json","type":"number"}},"allOf":[{"${'$'}comment":"${'$'}ref resolves to http://localhost:1234/sibling_id/base/foo.json, not http://localhost:1234/sibling_id/foo.json","${'$'}id":"http://localhost:1234/sibling_id/","${'$'}ref":"foo.json"}]} + """, + true, + """${'$'}ref prevents a sibling ${'$'}id from changing the base uri -> ${'$'}ref resolves to /definitions/base_foo, data validates""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "remote ref, containing refs itself -> remote ref valid" + */ + @Test + fun ref_remoteRef_ContainingRefsItself_remoteRefValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_remoteRef_ContainingRefsItself_remoteRefValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"minLength":1} + """, + """ + {"${'$'}ref":"http://json-schema.org/draft-07/schema#"} + """, + true, + """remote ref, containing refs itself -> remote ref valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "remote ref, containing refs itself -> remote ref invalid" + */ + @Test + fun ref_remoteRef_ContainingRefsItself_remoteRefInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_remoteRef_ContainingRefsItself_remoteRefInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"minLength":-1} + """, + """ + {"${'$'}ref":"http://json-schema.org/draft-07/schema#"} + """, + false, + """remote ref, containing refs itself -> remote ref invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "property named $ref that is not a reference -> property named $ref valid" + */ + @Test + fun ref_propertyNamed______refThatIsNotAReference_propertyNamed______refValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_propertyNamed______refThatIsNotAReference_propertyNamed______refValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"${'$'}ref":"a"} + """, + """ + {"properties":{"${'$'}ref":{"type":"string"}}} + """, + true, + """property named ${'$'}ref that is not a reference -> property named ${'$'}ref valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "property named $ref that is not a reference -> property named $ref invalid" + */ + @Test + fun ref_propertyNamed______refThatIsNotAReference_propertyNamed______refInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_propertyNamed______refThatIsNotAReference_propertyNamed______refInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"${'$'}ref":2} + """, + """ + {"properties":{"${'$'}ref":{"type":"string"}}} + """, + false, + """property named ${'$'}ref that is not a reference -> property named ${'$'}ref invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "property named $ref, containing an actual $ref -> property named $ref valid" + */ + @Test + fun ref_propertyNamed______ref_ContainingAnActual______ref_propertyNamed______refValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_propertyNamed______ref_ContainingAnActual______ref_propertyNamed______refValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"${'$'}ref":"a"} + """, + """ + {"properties":{"${'$'}ref":{"${'$'}ref":"#/definitions/is-string"}},"definitions":{"is-string":{"type":"string"}}} + """, + true, + """property named ${'$'}ref, containing an actual ${'$'}ref -> property named ${'$'}ref valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "property named $ref, containing an actual $ref -> property named $ref invalid" + */ + @Test + fun ref_propertyNamed______ref_ContainingAnActual______ref_propertyNamed______refInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_propertyNamed______ref_ContainingAnActual______ref_propertyNamed______refInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"${'$'}ref":2} + """, + """ + {"properties":{"${'$'}ref":{"${'$'}ref":"#/definitions/is-string"}},"definitions":{"is-string":{"type":"string"}}} + """, + false, + """property named ${'$'}ref, containing an actual ${'$'}ref -> property named ${'$'}ref invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "$ref to boolean schema true -> any value is valid" + */ + @Test + fun ref_______refToBooleanSchemaTrue_anyValueIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_______refToBooleanSchemaTrue_anyValueIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"allOf":[{"${'$'}ref":"#/definitions/bool"}],"definitions":{"bool":true}} + """, + true, + """${'$'}ref to boolean schema true -> any value is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "$ref to boolean schema false -> any value is invalid" + */ + @Test + fun ref_______refToBooleanSchemaFalse_anyValueIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_______refToBooleanSchemaFalse_anyValueIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"allOf":[{"${'$'}ref":"#/definitions/bool"}],"definitions":{"bool":false}} + """, + false, + """${'$'}ref to boolean schema false -> any value is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "Recursive references between schemas -> valid tree" + */ + @Test + fun ref_recursiveReferencesBetweenSchemas_validTree() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_recursiveReferencesBetweenSchemas_validTree" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"meta":"root","nodes":[{"value":1,"subtree":{"meta":"child","nodes":[{"value":1.1},{"value":1.2}]}},{"value":2,"subtree":{"meta":"child","nodes":[{"value":2.1},{"value":2.2}]}}]} + """, + """ + {"${'$'}id":"http://localhost:1234/tree","description":"tree of nodes","type":"object","properties":{"meta":{"type":"string"},"nodes":{"type":"array","items":{"${'$'}ref":"node"}}},"required":["meta","nodes"],"definitions":{"node":{"${'$'}id":"http://localhost:1234/node","description":"node","type":"object","properties":{"value":{"type":"number"},"subtree":{"${'$'}ref":"tree"}},"required":["value"]}}} + """, + true, + """Recursive references between schemas -> valid tree""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "Recursive references between schemas -> invalid tree" + */ + @Test + fun ref_recursiveReferencesBetweenSchemas_invalidTree() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_recursiveReferencesBetweenSchemas_invalidTree" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"meta":"root","nodes":[{"value":1,"subtree":{"meta":"child","nodes":[{"value":"string is invalid"},{"value":1.2}]}},{"value":2,"subtree":{"meta":"child","nodes":[{"value":2.1},{"value":2.2}]}}]} + """, + """ + {"${'$'}id":"http://localhost:1234/tree","description":"tree of nodes","type":"object","properties":{"meta":{"type":"string"},"nodes":{"type":"array","items":{"${'$'}ref":"node"}}},"required":["meta","nodes"],"definitions":{"node":{"${'$'}id":"http://localhost:1234/node","description":"node","type":"object","properties":{"value":{"type":"number"},"subtree":{"${'$'}ref":"tree"}},"required":["value"]}}} + """, + false, + """Recursive references between schemas -> invalid tree""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "refs with quote -> object with numbers is valid" + */ + @Test + fun ref_refsWithQuote_objectWithNumbersIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refsWithQuote_objectWithNumbersIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo\"bar":1} + """, + """ + {"properties":{"foo\"bar":{"${'$'}ref":"#/definitions/foo%22bar"}},"definitions":{"foo\"bar":{"type":"number"}}} + """, + true, + """refs with quote -> object with numbers is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "refs with quote -> object with strings is invalid" + */ + @Test + fun ref_refsWithQuote_objectWithStringsIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refsWithQuote_objectWithStringsIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo\"bar":"1"} + """, + """ + {"properties":{"foo\"bar":{"${'$'}ref":"#/definitions/foo%22bar"}},"definitions":{"foo\"bar":{"type":"number"}}} + """, + false, + """refs with quote -> object with strings is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "Location-independent identifier -> match" + */ + @Test + fun ref_location_independentIdentifier_match() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_location_independentIdentifier_match" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"allOf":[{"${'$'}ref":"#foo"}],"definitions":{"A":{"${'$'}id":"#foo","type":"integer"}}} + """, + true, + """Location-independent identifier -> match""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "Location-independent identifier -> mismatch" + */ + @Test + fun ref_location_independentIdentifier_mismatch() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_location_independentIdentifier_mismatch" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"allOf":[{"${'$'}ref":"#foo"}],"definitions":{"A":{"${'$'}id":"#foo","type":"integer"}}} + """, + false, + """Location-independent identifier -> mismatch""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "Reference an anchor with a non-relative URI -> match" + */ + @Test + fun ref_referenceAnAnchorWithANon_relativeURI_match() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_referenceAnAnchorWithANon_relativeURI_match" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"${'$'}id":"https://example.com/schema-with-anchor","allOf":[{"${'$'}ref":"https://example.com/schema-with-anchor#foo"}],"definitions":{"A":{"${'$'}id":"#foo","type":"integer"}}} + """, + true, + """Reference an anchor with a non-relative URI -> match""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "Reference an anchor with a non-relative URI -> mismatch" + */ + @Test + fun ref_referenceAnAnchorWithANon_relativeURI_mismatch() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_referenceAnAnchorWithANon_relativeURI_mismatch" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"${'$'}id":"https://example.com/schema-with-anchor","allOf":[{"${'$'}ref":"https://example.com/schema-with-anchor#foo"}],"definitions":{"A":{"${'$'}id":"#foo","type":"integer"}}} + """, + false, + """Reference an anchor with a non-relative URI -> mismatch""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "Location-independent identifier with base URI change in subschema -> match" + */ + @Test + fun ref_location_independentIdentifierWithBaseURIChangeInSubschema_match() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_location_independentIdentifierWithBaseURIChangeInSubschema_match" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"${'$'}id":"http://localhost:1234/root","allOf":[{"${'$'}ref":"http://localhost:1234/nested.json#foo"}],"definitions":{"A":{"${'$'}id":"nested.json","definitions":{"B":{"${'$'}id":"#foo","type":"integer"}}}}} + """, + true, + """Location-independent identifier with base URI change in subschema -> match""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "Location-independent identifier with base URI change in subschema -> mismatch" + */ + @Test + fun ref_location_independentIdentifierWithBaseURIChangeInSubschema_mismatch() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_location_independentIdentifierWithBaseURIChangeInSubschema_mismatch" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"${'$'}id":"http://localhost:1234/root","allOf":[{"${'$'}ref":"http://localhost:1234/nested.json#foo"}],"definitions":{"A":{"${'$'}id":"nested.json","definitions":{"B":{"${'$'}id":"#foo","type":"integer"}}}}} + """, + false, + """Location-independent identifier with base URI change in subschema -> mismatch""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "naive replacement of $ref with its destination is not correct -> do not evaluate the $ref inside the enum, matching any string" + */ + @Test + fun ref_naiveReplacementOf______refWithItsDestinationIsNotCorrect_doNotEvaluateThe______refInsideTheEnum_MatchingAnyString() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_naiveReplacementOf______refWithItsDestinationIsNotCorrect_doNotEvaluateThe______refInsideTheEnum_MatchingAnyString" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "this is a string" + """, + """ + {"definitions":{"a_string":{"type":"string"}},"enum":[{"${'$'}ref":"#/definitions/a_string"}]} + """, + false, + """naive replacement of ${'$'}ref with its destination is not correct -> do not evaluate the ${'$'}ref inside the enum, matching any string""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "naive replacement of $ref with its destination is not correct -> do not evaluate the $ref inside the enum, definition exact match" + */ + @Test + fun ref_naiveReplacementOf______refWithItsDestinationIsNotCorrect_doNotEvaluateThe______refInsideTheEnum_DefinitionExactMatch() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_naiveReplacementOf______refWithItsDestinationIsNotCorrect_doNotEvaluateThe______refInsideTheEnum_DefinitionExactMatch" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"type":"string"} + """, + """ + {"definitions":{"a_string":{"type":"string"}},"enum":[{"${'$'}ref":"#/definitions/a_string"}]} + """, + false, + """naive replacement of ${'$'}ref with its destination is not correct -> do not evaluate the ${'$'}ref inside the enum, definition exact match""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "naive replacement of $ref with its destination is not correct -> match the enum exactly" + */ + @Test + fun ref_naiveReplacementOf______refWithItsDestinationIsNotCorrect_matchTheEnumExactly() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_naiveReplacementOf______refWithItsDestinationIsNotCorrect_matchTheEnumExactly" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"${'$'}ref":"#/definitions/a_string"} + """, + """ + {"definitions":{"a_string":{"type":"string"}},"enum":[{"${'$'}ref":"#/definitions/a_string"}]} + """, + true, + """naive replacement of ${'$'}ref with its destination is not correct -> match the enum exactly""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "refs with relative uris and defs -> invalid on inner field" + */ + @Test + fun ref_refsWithRelativeUrisAndDefs_invalidOnInnerField() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refsWithRelativeUrisAndDefs_invalidOnInnerField" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":{"bar":1},"bar":"a"} + """, + """ + {"${'$'}id":"http://example.com/schema-relative-uri-defs1.json","properties":{"foo":{"${'$'}id":"schema-relative-uri-defs2.json","definitions":{"inner":{"properties":{"bar":{"type":"string"}}}},"allOf":[{"${'$'}ref":"#/definitions/inner"}]}},"allOf":[{"${'$'}ref":"schema-relative-uri-defs2.json"}]} + """, + false, + """refs with relative uris and defs -> invalid on inner field""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "refs with relative uris and defs -> invalid on outer field" + */ + @Test + fun ref_refsWithRelativeUrisAndDefs_invalidOnOuterField() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refsWithRelativeUrisAndDefs_invalidOnOuterField" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":{"bar":"a"},"bar":1} + """, + """ + {"${'$'}id":"http://example.com/schema-relative-uri-defs1.json","properties":{"foo":{"${'$'}id":"schema-relative-uri-defs2.json","definitions":{"inner":{"properties":{"bar":{"type":"string"}}}},"allOf":[{"${'$'}ref":"#/definitions/inner"}]}},"allOf":[{"${'$'}ref":"schema-relative-uri-defs2.json"}]} + """, + false, + """refs with relative uris and defs -> invalid on outer field""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "refs with relative uris and defs -> valid on both fields" + */ + @Test + fun ref_refsWithRelativeUrisAndDefs_validOnBothFields() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refsWithRelativeUrisAndDefs_validOnBothFields" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":{"bar":"a"},"bar":"a"} + """, + """ + {"${'$'}id":"http://example.com/schema-relative-uri-defs1.json","properties":{"foo":{"${'$'}id":"schema-relative-uri-defs2.json","definitions":{"inner":{"properties":{"bar":{"type":"string"}}}},"allOf":[{"${'$'}ref":"#/definitions/inner"}]}},"allOf":[{"${'$'}ref":"schema-relative-uri-defs2.json"}]} + """, + true, + """refs with relative uris and defs -> valid on both fields""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "relative refs with absolute uris and defs -> invalid on inner field" + */ + @Test + fun ref_relativeRefsWithAbsoluteUrisAndDefs_invalidOnInnerField() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_relativeRefsWithAbsoluteUrisAndDefs_invalidOnInnerField" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":{"bar":1},"bar":"a"} + """, + """ + {"${'$'}id":"http://example.com/schema-refs-absolute-uris-defs1.json","properties":{"foo":{"${'$'}id":"http://example.com/schema-refs-absolute-uris-defs2.json","definitions":{"inner":{"properties":{"bar":{"type":"string"}}}},"allOf":[{"${'$'}ref":"#/definitions/inner"}]}},"allOf":[{"${'$'}ref":"schema-refs-absolute-uris-defs2.json"}]} + """, + false, + """relative refs with absolute uris and defs -> invalid on inner field""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "relative refs with absolute uris and defs -> invalid on outer field" + */ + @Test + fun ref_relativeRefsWithAbsoluteUrisAndDefs_invalidOnOuterField() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_relativeRefsWithAbsoluteUrisAndDefs_invalidOnOuterField" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":{"bar":"a"},"bar":1} + """, + """ + {"${'$'}id":"http://example.com/schema-refs-absolute-uris-defs1.json","properties":{"foo":{"${'$'}id":"http://example.com/schema-refs-absolute-uris-defs2.json","definitions":{"inner":{"properties":{"bar":{"type":"string"}}}},"allOf":[{"${'$'}ref":"#/definitions/inner"}]}},"allOf":[{"${'$'}ref":"schema-refs-absolute-uris-defs2.json"}]} + """, + false, + """relative refs with absolute uris and defs -> invalid on outer field""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "relative refs with absolute uris and defs -> valid on both fields" + */ + @Test + fun ref_relativeRefsWithAbsoluteUrisAndDefs_validOnBothFields() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_relativeRefsWithAbsoluteUrisAndDefs_validOnBothFields" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":{"bar":"a"},"bar":"a"} + """, + """ + {"${'$'}id":"http://example.com/schema-refs-absolute-uris-defs1.json","properties":{"foo":{"${'$'}id":"http://example.com/schema-refs-absolute-uris-defs2.json","definitions":{"inner":{"properties":{"bar":{"type":"string"}}}},"allOf":[{"${'$'}ref":"#/definitions/inner"}]}},"allOf":[{"${'$'}ref":"schema-refs-absolute-uris-defs2.json"}]} + """, + true, + """relative refs with absolute uris and defs -> valid on both fields""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "$id must be resolved against nearest parent, not just immediate parent -> number is valid" + */ + @Test + fun ref_______idMustBeResolvedAgainstNearestParent_NotJustImmediateParent_numberIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_______idMustBeResolvedAgainstNearestParent_NotJustImmediateParent_numberIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"${'$'}id":"http://example.com/a.json","definitions":{"x":{"${'$'}id":"http://example.com/b/c.json","not":{"definitions":{"y":{"${'$'}id":"d.json","type":"number"}}}}},"allOf":[{"${'$'}ref":"http://example.com/b/d.json"}]} + """, + true, + """${'$'}id must be resolved against nearest parent, not just immediate parent -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "$id must be resolved against nearest parent, not just immediate parent -> non-number is invalid" + */ + @Test + fun ref_______idMustBeResolvedAgainstNearestParent_NotJustImmediateParent_non_numberIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_______idMustBeResolvedAgainstNearestParent_NotJustImmediateParent_non_numberIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"${'$'}id":"http://example.com/a.json","definitions":{"x":{"${'$'}id":"http://example.com/b/c.json","not":{"definitions":{"y":{"${'$'}id":"d.json","type":"number"}}}}},"allOf":[{"${'$'}ref":"http://example.com/b/d.json"}]} + """, + false, + """${'$'}id must be resolved against nearest parent, not just immediate parent -> non-number is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "simple URN base URI with $ref via the URN -> valid under the URN IDed schema" + */ + @Test + fun ref_simpleURNBaseURIWith______refViaTheURN_validUnderTheURNIDedSchema() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_simpleURNBaseURIWith______refViaTheURN_validUnderTheURNIDedSchema" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":37} + """, + """ + {"${'$'}comment":"URIs do not have to have HTTP(s) schemes","${'$'}id":"urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed","minimum":30,"properties":{"foo":{"${'$'}ref":"urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed"}}} + """, + true, + """simple URN base URI with ${'$'}ref via the URN -> valid under the URN IDed schema""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "simple URN base URI with $ref via the URN -> invalid under the URN IDed schema" + */ + @Test + fun ref_simpleURNBaseURIWith______refViaTheURN_invalidUnderTheURNIDedSchema() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_simpleURNBaseURIWith______refViaTheURN_invalidUnderTheURNIDedSchema" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":12} + """, + """ + {"${'$'}comment":"URIs do not have to have HTTP(s) schemes","${'$'}id":"urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed","minimum":30,"properties":{"foo":{"${'$'}ref":"urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed"}}} + """, + false, + """simple URN base URI with ${'$'}ref via the URN -> invalid under the URN IDed schema""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "simple URN base URI with JSON pointer -> a string is valid" + */ + @Test + fun ref_simpleURNBaseURIWithJSONPointer_aStringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_simpleURNBaseURIWithJSONPointer_aStringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"${'$'}comment":"URIs do not have to have HTTP(s) schemes","${'$'}id":"urn:uuid:deadbeef-1234-00ff-ff00-4321feebdaed","properties":{"foo":{"${'$'}ref":"#/definitions/bar"}},"definitions":{"bar":{"type":"string"}}} + """, + true, + """simple URN base URI with JSON pointer -> a string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "simple URN base URI with JSON pointer -> a non-string is invalid" + */ + @Test + fun ref_simpleURNBaseURIWithJSONPointer_aNon_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_simpleURNBaseURIWithJSONPointer_aNon_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":12} + """, + """ + {"${'$'}comment":"URIs do not have to have HTTP(s) schemes","${'$'}id":"urn:uuid:deadbeef-1234-00ff-ff00-4321feebdaed","properties":{"foo":{"${'$'}ref":"#/definitions/bar"}},"definitions":{"bar":{"type":"string"}}} + """, + false, + """simple URN base URI with JSON pointer -> a non-string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "URN base URI with NSS -> a string is valid" + */ + @Test + fun ref_uRNBaseURIWithNSS_aStringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_uRNBaseURIWithNSS_aStringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"${'$'}comment":"RFC 8141 §2.2","${'$'}id":"urn:example:1/406/47452/2","properties":{"foo":{"${'$'}ref":"#/definitions/bar"}},"definitions":{"bar":{"type":"string"}}} + """, + true, + """URN base URI with NSS -> a string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "URN base URI with NSS -> a non-string is invalid" + */ + @Test + fun ref_uRNBaseURIWithNSS_aNon_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_uRNBaseURIWithNSS_aNon_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":12} + """, + """ + {"${'$'}comment":"RFC 8141 §2.2","${'$'}id":"urn:example:1/406/47452/2","properties":{"foo":{"${'$'}ref":"#/definitions/bar"}},"definitions":{"bar":{"type":"string"}}} + """, + false, + """URN base URI with NSS -> a non-string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "URN base URI with r-component -> a string is valid" + */ + @Test + fun ref_uRNBaseURIWithR_component_aStringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_uRNBaseURIWithR_component_aStringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"${'$'}comment":"RFC 8141 §2.3.1","${'$'}id":"urn:example:foo-bar-baz-qux?+CCResolve:cc=uk","properties":{"foo":{"${'$'}ref":"#/definitions/bar"}},"definitions":{"bar":{"type":"string"}}} + """, + true, + """URN base URI with r-component -> a string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "URN base URI with r-component -> a non-string is invalid" + */ + @Test + fun ref_uRNBaseURIWithR_component_aNon_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_uRNBaseURIWithR_component_aNon_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":12} + """, + """ + {"${'$'}comment":"RFC 8141 §2.3.1","${'$'}id":"urn:example:foo-bar-baz-qux?+CCResolve:cc=uk","properties":{"foo":{"${'$'}ref":"#/definitions/bar"}},"definitions":{"bar":{"type":"string"}}} + """, + false, + """URN base URI with r-component -> a non-string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "URN base URI with q-component -> a string is valid" + */ + @Test + fun ref_uRNBaseURIWithQ_component_aStringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_uRNBaseURIWithQ_component_aStringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"${'$'}comment":"RFC 8141 §2.3.2","${'$'}id":"urn:example:weather?=op=map&lat=39.56&lon=-104.85&datetime=1969-07-21T02:56:15Z","properties":{"foo":{"${'$'}ref":"#/definitions/bar"}},"definitions":{"bar":{"type":"string"}}} + """, + true, + """URN base URI with q-component -> a string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "URN base URI with q-component -> a non-string is invalid" + */ + @Test + fun ref_uRNBaseURIWithQ_component_aNon_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_uRNBaseURIWithQ_component_aNon_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":12} + """, + """ + {"${'$'}comment":"RFC 8141 §2.3.2","${'$'}id":"urn:example:weather?=op=map&lat=39.56&lon=-104.85&datetime=1969-07-21T02:56:15Z","properties":{"foo":{"${'$'}ref":"#/definitions/bar"}},"definitions":{"bar":{"type":"string"}}} + """, + false, + """URN base URI with q-component -> a non-string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "URN base URI with URN and JSON pointer ref -> a string is valid" + */ + @Test + fun ref_uRNBaseURIWithURNAndJSONPointerRef_aStringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_uRNBaseURIWithURNAndJSONPointerRef_aStringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"${'$'}id":"urn:uuid:deadbeef-1234-0000-0000-4321feebdaed","properties":{"foo":{"${'$'}ref":"urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/definitions/bar"}},"definitions":{"bar":{"type":"string"}}} + """, + true, + """URN base URI with URN and JSON pointer ref -> a string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "URN base URI with URN and JSON pointer ref -> a non-string is invalid" + */ + @Test + fun ref_uRNBaseURIWithURNAndJSONPointerRef_aNon_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_uRNBaseURIWithURNAndJSONPointerRef_aNon_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":12} + """, + """ + {"${'$'}id":"urn:uuid:deadbeef-1234-0000-0000-4321feebdaed","properties":{"foo":{"${'$'}ref":"urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/definitions/bar"}},"definitions":{"bar":{"type":"string"}}} + """, + false, + """URN base URI with URN and JSON pointer ref -> a non-string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "URN base URI with URN and anchor ref -> a string is valid" + */ + @Test + fun ref_uRNBaseURIWithURNAndAnchorRef_aStringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_uRNBaseURIWithURNAndAnchorRef_aStringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":"bar"} + """, + """ + {"${'$'}id":"urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed","properties":{"foo":{"${'$'}ref":"urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something"}},"definitions":{"bar":{"${'$'}id":"#something","type":"string"}}} + """, + true, + """URN base URI with URN and anchor ref -> a string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "URN base URI with URN and anchor ref -> a non-string is invalid" + */ + @Test + fun ref_uRNBaseURIWithURNAndAnchorRef_aNon_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_uRNBaseURIWithURNAndAnchorRef_aNon_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":12} + """, + """ + {"${'$'}id":"urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed","properties":{"foo":{"${'$'}ref":"urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something"}},"definitions":{"bar":{"${'$'}id":"#something","type":"string"}}} + """, + false, + """URN base URI with URN and anchor ref -> a non-string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "ref to if -> a non-integer is invalid due to the $ref" + */ + @Test + fun ref_refToIf_aNon_integerIsInvalidDueToThe______ref() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refToIf_aNon_integerIsInvalidDueToThe______ref" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"allOf":[{"${'$'}ref":"http://example.com/ref/if"},{"if":{"${'$'}id":"http://example.com/ref/if","type":"integer"}}]} + """, + false, + """ref to if -> a non-integer is invalid due to the ${'$'}ref""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "ref to if -> an integer is valid" + */ + @Test + fun ref_refToIf_anIntegerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refToIf_anIntegerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"allOf":[{"${'$'}ref":"http://example.com/ref/if"},{"if":{"${'$'}id":"http://example.com/ref/if","type":"integer"}}]} + """, + true, + """ref to if -> an integer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "ref to then -> a non-integer is invalid due to the $ref" + */ + @Test + fun ref_refToThen_aNon_integerIsInvalidDueToThe______ref() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refToThen_aNon_integerIsInvalidDueToThe______ref" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"allOf":[{"${'$'}ref":"http://example.com/ref/then"},{"then":{"${'$'}id":"http://example.com/ref/then","type":"integer"}}]} + """, + false, + """ref to then -> a non-integer is invalid due to the ${'$'}ref""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "ref to then -> an integer is valid" + */ + @Test + fun ref_refToThen_anIntegerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refToThen_anIntegerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"allOf":[{"${'$'}ref":"http://example.com/ref/then"},{"then":{"${'$'}id":"http://example.com/ref/then","type":"integer"}}]} + """, + true, + """ref to then -> an integer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "ref to else -> a non-integer is invalid due to the $ref" + */ + @Test + fun ref_refToElse_aNon_integerIsInvalidDueToThe______ref() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refToElse_aNon_integerIsInvalidDueToThe______ref" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"allOf":[{"${'$'}ref":"http://example.com/ref/else"},{"else":{"${'$'}id":"http://example.com/ref/else","type":"integer"}}]} + """, + false, + """ref to else -> a non-integer is invalid due to the ${'$'}ref""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "ref to else -> an integer is valid" + */ + @Test + fun ref_refToElse_anIntegerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refToElse_anIntegerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"allOf":[{"${'$'}ref":"http://example.com/ref/else"},{"else":{"${'$'}id":"http://example.com/ref/else","type":"integer"}}]} + """, + true, + """ref to else -> an integer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "ref with absolute-path-reference -> a string is valid" + */ + @Test + fun ref_refWithAbsolute_path_reference_aStringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refWithAbsolute_path_reference_aStringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"${'$'}id":"http://example.com/ref/absref.json","definitions":{"a":{"${'$'}id":"http://example.com/ref/absref/foobar.json","type":"number"},"b":{"${'$'}id":"http://example.com/absref/foobar.json","type":"string"}},"allOf":[{"${'$'}ref":"/absref/foobar.json"}]} + """, + true, + """ref with absolute-path-reference -> a string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "ref with absolute-path-reference -> an integer is invalid" + */ + @Test + fun ref_refWithAbsolute_path_reference_anIntegerIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_refWithAbsolute_path_reference_anIntegerIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"${'$'}id":"http://example.com/ref/absref.json","definitions":{"a":{"${'$'}id":"http://example.com/ref/absref/foobar.json","type":"number"},"b":{"${'$'}id":"http://example.com/absref/foobar.json","type":"string"}},"allOf":[{"${'$'}ref":"/absref/foobar.json"}]} + """, + false, + """ref with absolute-path-reference -> an integer is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "$id with file URI still resolves pointers - *nix -> number is valid" + */ + @Test + fun ref_______idWithFileURIStillResolvesPointers__nix_numberIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_______idWithFileURIStillResolvesPointers__nix_numberIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"${'$'}id":"file:///folder/file.json","definitions":{"foo":{"type":"number"}},"allOf":[{"${'$'}ref":"#/definitions/foo"}]} + """, + true, + """${'$'}id with file URI still resolves pointers - *nix -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "$id with file URI still resolves pointers - *nix -> non-number is invalid" + */ + @Test + fun ref_______idWithFileURIStillResolvesPointers__nix_non_numberIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_______idWithFileURIStillResolvesPointers__nix_non_numberIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"${'$'}id":"file:///folder/file.json","definitions":{"foo":{"type":"number"}},"allOf":[{"${'$'}ref":"#/definitions/foo"}]} + """, + false, + """${'$'}id with file URI still resolves pointers - *nix -> non-number is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "$id with file URI still resolves pointers - windows -> number is valid" + */ + @Test + fun ref_______idWithFileURIStillResolvesPointers_Windows_numberIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_______idWithFileURIStillResolvesPointers_Windows_numberIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"${'$'}id":"file:///c:/folder/file.json","definitions":{"foo":{"type":"number"}},"allOf":[{"${'$'}ref":"#/definitions/foo"}]} + """, + true, + """${'$'}id with file URI still resolves pointers - windows -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "$id with file URI still resolves pointers - windows -> non-number is invalid" + */ + @Test + fun ref_______idWithFileURIStillResolvesPointers_Windows_non_numberIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_______idWithFileURIStillResolvesPointers_Windows_non_numberIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"${'$'}id":"file:///c:/folder/file.json","definitions":{"foo":{"type":"number"}},"allOf":[{"${'$'}ref":"#/definitions/foo"}]} + """, + false, + """${'$'}id with file URI still resolves pointers - windows -> non-number is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "empty tokens in $ref json-pointer -> number is valid" + */ + @Test + fun ref_emptyTokensIn______refJson_pointer_numberIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_emptyTokensIn______refJson_pointer_numberIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"definitions":{"":{"definitions":{"":{"type":"number"}}}},"allOf":[{"${'$'}ref":"#/definitions//definitions/"}]} + """, + true, + """empty tokens in ${'$'}ref json-pointer -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/ref.json`: + * "empty tokens in $ref json-pointer -> non-number is invalid" + */ + @Test + fun ref_emptyTokensIn______refJson_pointer_non_numberIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "ref_emptyTokensIn______refJson_pointer_non_numberIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"definitions":{"":{"definitions":{"":{"type":"number"}}}},"allOf":[{"${'$'}ref":"#/definitions//definitions/"}]} + """, + false, + """empty tokens in ${'$'}ref json-pointer -> non-number is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "remote ref -> remote ref valid" + */ + @Test + fun refRemote_remoteRef_remoteRefValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_remoteRef_remoteRefValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"${'$'}ref":"http://localhost:1234/integer.json"} + """, + true, + """remote ref -> remote ref valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "remote ref -> remote ref invalid" + */ + @Test + fun refRemote_remoteRef_remoteRefInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_remoteRef_remoteRefInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"${'$'}ref":"http://localhost:1234/integer.json"} + """, + false, + """remote ref -> remote ref invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "fragment within remote ref -> remote fragment valid" + */ + @Test + fun refRemote_fragmentWithinRemoteRef_remoteFragmentValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_fragmentWithinRemoteRef_remoteFragmentValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"${'$'}ref":"http://localhost:1234/subSchemas.json#/definitions/integer"} + """, + true, + """fragment within remote ref -> remote fragment valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "fragment within remote ref -> remote fragment invalid" + */ + @Test + fun refRemote_fragmentWithinRemoteRef_remoteFragmentInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_fragmentWithinRemoteRef_remoteFragmentInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"${'$'}ref":"http://localhost:1234/subSchemas.json#/definitions/integer"} + """, + false, + """fragment within remote ref -> remote fragment invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "ref within remote ref -> ref within ref valid" + */ + @Test + fun refRemote_refWithinRemoteRef_refWithinRefValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_refWithinRemoteRef_refWithinRefValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"${'$'}ref":"http://localhost:1234/subSchemas.json#/definitions/refToInteger"} + """, + true, + """ref within remote ref -> ref within ref valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "ref within remote ref -> ref within ref invalid" + */ + @Test + fun refRemote_refWithinRemoteRef_refWithinRefInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_refWithinRemoteRef_refWithinRefInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"${'$'}ref":"http://localhost:1234/subSchemas.json#/definitions/refToInteger"} + """, + false, + """ref within remote ref -> ref within ref invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "base URI change -> base URI change ref valid" + */ + @Test + fun refRemote_baseURIChange_baseURIChangeRefValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_baseURIChange_baseURIChangeRefValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[1]] + """, + """ + {"${'$'}id":"http://localhost:1234/","items":{"${'$'}id":"baseUriChange/","items":{"${'$'}ref":"folderInteger.json"}}} + """, + true, + """base URI change -> base URI change ref valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "base URI change -> base URI change ref invalid" + */ + @Test + fun refRemote_baseURIChange_baseURIChangeRefInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_baseURIChange_baseURIChangeRefInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [["a"]] + """, + """ + {"${'$'}id":"http://localhost:1234/","items":{"${'$'}id":"baseUriChange/","items":{"${'$'}ref":"folderInteger.json"}}} + """, + false, + """base URI change -> base URI change ref invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "base URI change - change folder -> number is valid" + */ + @Test + fun refRemote_baseURIChange_ChangeFolder_numberIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_baseURIChange_ChangeFolder_numberIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"list":[1]} + """, + """ + {"${'$'}id":"http://localhost:1234/scope_change_defs1.json","type":"object","properties":{"list":{"${'$'}ref":"#/definitions/baz"}},"definitions":{"baz":{"${'$'}id":"baseUriChangeFolder/","type":"array","items":{"${'$'}ref":"folderInteger.json"}}}} + """, + true, + """base URI change - change folder -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "base URI change - change folder -> string is invalid" + */ + @Test + fun refRemote_baseURIChange_ChangeFolder_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_baseURIChange_ChangeFolder_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"list":["a"]} + """, + """ + {"${'$'}id":"http://localhost:1234/scope_change_defs1.json","type":"object","properties":{"list":{"${'$'}ref":"#/definitions/baz"}},"definitions":{"baz":{"${'$'}id":"baseUriChangeFolder/","type":"array","items":{"${'$'}ref":"folderInteger.json"}}}} + """, + false, + """base URI change - change folder -> string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "base URI change - change folder in subschema -> number is valid" + */ + @Test + fun refRemote_baseURIChange_ChangeFolderInSubschema_numberIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_baseURIChange_ChangeFolderInSubschema_numberIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"list":[1]} + """, + """ + {"${'$'}id":"http://localhost:1234/scope_change_defs2.json","type":"object","properties":{"list":{"${'$'}ref":"#/definitions/baz/definitions/bar"}},"definitions":{"baz":{"${'$'}id":"baseUriChangeFolderInSubschema/","definitions":{"bar":{"type":"array","items":{"${'$'}ref":"folderInteger.json"}}}}}} + """, + true, + """base URI change - change folder in subschema -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "base URI change - change folder in subschema -> string is invalid" + */ + @Test + fun refRemote_baseURIChange_ChangeFolderInSubschema_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_baseURIChange_ChangeFolderInSubschema_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"list":["a"]} + """, + """ + {"${'$'}id":"http://localhost:1234/scope_change_defs2.json","type":"object","properties":{"list":{"${'$'}ref":"#/definitions/baz/definitions/bar"}},"definitions":{"baz":{"${'$'}id":"baseUriChangeFolderInSubschema/","definitions":{"bar":{"type":"array","items":{"${'$'}ref":"folderInteger.json"}}}}}} + """, + false, + """base URI change - change folder in subschema -> string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "root ref in remote ref -> string is valid" + */ + @Test + fun refRemote_rootRefInRemoteRef_stringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_rootRefInRemoteRef_stringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"name":"foo"} + """, + """ + {"${'$'}id":"http://localhost:1234/object","type":"object","properties":{"name":{"${'$'}ref":"name.json#/definitions/orNull"}}} + """, + true, + """root ref in remote ref -> string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "root ref in remote ref -> null is valid" + */ + @Test + fun refRemote_rootRefInRemoteRef_nullIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_rootRefInRemoteRef_nullIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"name":null} + """, + """ + {"${'$'}id":"http://localhost:1234/object","type":"object","properties":{"name":{"${'$'}ref":"name.json#/definitions/orNull"}}} + """, + true, + """root ref in remote ref -> null is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "root ref in remote ref -> object is invalid" + */ + @Test + fun refRemote_rootRefInRemoteRef_objectIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_rootRefInRemoteRef_objectIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"name":{"name":null}} + """, + """ + {"${'$'}id":"http://localhost:1234/object","type":"object","properties":{"name":{"${'$'}ref":"name.json#/definitions/orNull"}}} + """, + false, + """root ref in remote ref -> object is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "remote ref with ref to definitions -> invalid" + */ + @Test + fun refRemote_remoteRefWithRefToDefinitions_invalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_remoteRefWithRefToDefinitions_invalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":1} + """, + """ + {"${'$'}id":"http://localhost:1234/schema-remote-ref-ref-defs1.json","allOf":[{"${'$'}ref":"ref-and-definitions.json"}]} + """, + false, + """remote ref with ref to definitions -> invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "remote ref with ref to definitions -> valid" + */ + @Test + fun refRemote_remoteRefWithRefToDefinitions_valid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_remoteRefWithRefToDefinitions_valid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":"a"} + """, + """ + {"${'$'}id":"http://localhost:1234/schema-remote-ref-ref-defs1.json","allOf":[{"${'$'}ref":"ref-and-definitions.json"}]} + """, + true, + """remote ref with ref to definitions -> valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "Location-independent identifier in remote ref -> integer is valid" + */ + @Test + fun refRemote_location_independentIdentifierInRemoteRef_integerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_location_independentIdentifierInRemoteRef_integerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"${'$'}ref":"http://localhost:1234/locationIndependentIdentifierPre2019.json#/definitions/refToInteger"} + """, + true, + """Location-independent identifier in remote ref -> integer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "Location-independent identifier in remote ref -> string is invalid" + */ + @Test + fun refRemote_location_independentIdentifierInRemoteRef_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_location_independentIdentifierInRemoteRef_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"${'$'}ref":"http://localhost:1234/locationIndependentIdentifierPre2019.json#/definitions/refToInteger"} + """, + false, + """Location-independent identifier in remote ref -> string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "retrieved nested refs resolve relative to their URI not $id -> number is invalid" + */ + @Test + fun refRemote_retrievedNestedRefsResolveRelativeToTheirURINot______id_numberIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_retrievedNestedRefsResolveRelativeToTheirURINot______id_numberIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"name":{"foo":1}} + """, + """ + {"${'$'}id":"http://localhost:1234/some-id","properties":{"name":{"${'$'}ref":"nested/foo-ref-string.json"}}} + """, + false, + """retrieved nested refs resolve relative to their URI not ${'$'}id -> number is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "retrieved nested refs resolve relative to their URI not $id -> string is valid" + */ + @Test + fun refRemote_retrievedNestedRefsResolveRelativeToTheirURINot______id_stringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_retrievedNestedRefsResolveRelativeToTheirURINot______id_stringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"name":{"foo":"a"}} + """, + """ + {"${'$'}id":"http://localhost:1234/some-id","properties":{"name":{"${'$'}ref":"nested/foo-ref-string.json"}}} + """, + true, + """retrieved nested refs resolve relative to their URI not ${'$'}id -> string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "$ref to $ref finds location-independent $id -> number is valid" + */ + @Test + fun refRemote_______refTo______refFindsLocation_independent______id_numberIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_______refTo______refFindsLocation_independent______id_numberIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"${'$'}ref":"http://localhost:1234/draft7/detached-ref.json#/definitions/foo"} + """, + true, + """${'$'}ref to ${'$'}ref finds location-independent ${'$'}id -> number is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/refRemote.json`: + * "$ref to $ref finds location-independent $id -> non-number is invalid" + */ + @Test + fun refRemote_______refTo______refFindsLocation_independent______id_non_numberIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "refRemote_______refTo______refFindsLocation_independent______id_non_numberIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "a" + """, + """ + {"${'$'}ref":"http://localhost:1234/draft7/detached-ref.json#/definitions/foo"} + """, + false, + """${'$'}ref to ${'$'}ref finds location-independent ${'$'}id -> non-number is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required validation -> present required property is valid" + */ + @Test + fun required_requiredValidation_presentRequiredPropertyIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredValidation_presentRequiredPropertyIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":1} + """, + """ + {"properties":{"foo":{},"bar":{}},"required":["foo"]} + """, + true, + """required validation -> present required property is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required validation -> non-present required property is invalid" + */ + @Test + fun required_requiredValidation_non_presentRequiredPropertyIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredValidation_non_presentRequiredPropertyIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"bar":1} + """, + """ + {"properties":{"foo":{},"bar":{}},"required":["foo"]} + """, + false, + """required validation -> non-present required property is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required validation -> ignores arrays" + */ + @Test + fun required_requiredValidation_ignoresArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredValidation_ignoresArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"properties":{"foo":{},"bar":{}},"required":["foo"]} + """, + true, + """required validation -> ignores arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required validation -> ignores strings" + */ + @Test + fun required_requiredValidation_ignoresStrings() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredValidation_ignoresStrings" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "" + """, + """ + {"properties":{"foo":{},"bar":{}},"required":["foo"]} + """, + true, + """required validation -> ignores strings""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required validation -> ignores other non-objects" + */ + @Test + fun required_requiredValidation_ignoresOtherNon_objects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredValidation_ignoresOtherNon_objects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + {"properties":{"foo":{},"bar":{}},"required":["foo"]} + """, + true, + """required validation -> ignores other non-objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required default validation -> not required by default" + */ + @Test + fun required_requiredDefaultValidation_notRequiredByDefault() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredDefaultValidation_notRequiredByDefault" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"properties":{"foo":{}}} + """, + true, + """required default validation -> not required by default""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required with empty array -> property not required" + */ + @Test + fun required_requiredWithEmptyArray_propertyNotRequired() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredWithEmptyArray_propertyNotRequired" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"properties":{"foo":{}},"required":[]} + """, + true, + """required with empty array -> property not required""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required with escaped characters -> object with all properties present is valid" + */ + @Test + fun required_requiredWithEscapedCharacters_objectWithAllPropertiesPresentIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredWithEscapedCharacters_objectWithAllPropertiesPresentIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo\nbar":1,"foo\"bar":1,"foo\\bar":1,"foo\rbar":1,"foo\tbar":1,"foo\fbar":1} + """, + """ + {"required":["foo\nbar","foo\"bar","foo\\bar","foo\rbar","foo\tbar","foo\fbar"]} + """, + true, + """required with escaped characters -> object with all properties present is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required with escaped characters -> object with some properties missing is invalid" + */ + @Test + fun required_requiredWithEscapedCharacters_objectWithSomePropertiesMissingIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredWithEscapedCharacters_objectWithSomePropertiesMissingIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo\nbar":"1","foo\"bar":"1"} + """, + """ + {"required":["foo\nbar","foo\"bar","foo\\bar","foo\rbar","foo\tbar","foo\fbar"]} + """, + false, + """required with escaped characters -> object with some properties missing is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required properties whose names are Javascript object property names -> ignores arrays" + */ + @Test + fun required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_ignoresArrays() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_ignoresArrays" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"required":["__proto__","toString","constructor"]} + """, + true, + """required properties whose names are Javascript object property names -> ignores arrays""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required properties whose names are Javascript object property names -> ignores other non-objects" + */ + @Test + fun required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_ignoresOtherNon_objects() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_ignoresOtherNon_objects" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 12 + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"required":["__proto__","toString","constructor"]} + """, + true, + """required properties whose names are Javascript object property names -> ignores other non-objects""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required properties whose names are Javascript object property names -> none of the properties mentioned" + */ + @Test + fun required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_noneOfThePropertiesMentioned() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_noneOfThePropertiesMentioned" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"required":["__proto__","toString","constructor"]} + """, + false, + """required properties whose names are Javascript object property names -> none of the properties mentioned""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required properties whose names are Javascript object property names -> __proto__ present" + */ + @Test + fun required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames___proto__Present() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames___proto__Present" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"__proto__":"foo"} + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"required":["__proto__","toString","constructor"]} + """, + false, + """required properties whose names are Javascript object property names -> __proto__ present""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required properties whose names are Javascript object property names -> toString present" + */ + @Test + fun required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_toStringPresent() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_toStringPresent" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"toString":{"length":37}} + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"required":["__proto__","toString","constructor"]} + """, + false, + """required properties whose names are Javascript object property names -> toString present""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required properties whose names are Javascript object property names -> constructor present" + */ + @Test + fun required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_constructorPresent() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_constructorPresent" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"constructor":{"length":37}} + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"required":["__proto__","toString","constructor"]} + """, + false, + """required properties whose names are Javascript object property names -> constructor present""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/required.json`: + * "required properties whose names are Javascript object property names -> all present" + */ + @Test + fun required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_allPresent() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "required_requiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames_allPresent" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"__proto__":12,"toString":{"length":"foo"},"constructor":37} + """, + """ + // Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object. +{"required":["__proto__","toString","constructor"]} + """, + true, + """required properties whose names are Javascript object property names -> all present""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "integer type matches integers -> an integer is an integer" + */ + @Test + fun type_integerTypeMatchesIntegers_anIntegerIsAnInteger() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_integerTypeMatchesIntegers_anIntegerIsAnInteger" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"type":"integer"} + """, + true, + """integer type matches integers -> an integer is an integer""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "integer type matches integers -> a float with zero fractional part is an integer" + */ + @Test + fun type_integerTypeMatchesIntegers_aFloatWithZeroFractionalPartIsAnInteger() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_integerTypeMatchesIntegers_aFloatWithZeroFractionalPartIsAnInteger" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.0 + """, + """ + {"type":"integer"} + """, + true, + """integer type matches integers -> a float with zero fractional part is an integer""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "integer type matches integers -> a float is not an integer" + */ + @Test + fun type_integerTypeMatchesIntegers_aFloatIsNotAnInteger() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_integerTypeMatchesIntegers_aFloatIsNotAnInteger" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.1 + """, + """ + {"type":"integer"} + """, + false, + """integer type matches integers -> a float is not an integer""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "integer type matches integers -> a string is not an integer" + */ + @Test + fun type_integerTypeMatchesIntegers_aStringIsNotAnInteger() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_integerTypeMatchesIntegers_aStringIsNotAnInteger" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":"integer"} + """, + false, + """integer type matches integers -> a string is not an integer""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "integer type matches integers -> a string is still not an integer, even if it looks like one" + */ + @Test + fun type_integerTypeMatchesIntegers_aStringIsStillNotAnInteger_EvenIfItLooksLikeOne() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_integerTypeMatchesIntegers_aStringIsStillNotAnInteger_EvenIfItLooksLikeOne" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "1" + """, + """ + {"type":"integer"} + """, + false, + """integer type matches integers -> a string is still not an integer, even if it looks like one""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "integer type matches integers -> an object is not an integer" + */ + @Test + fun type_integerTypeMatchesIntegers_anObjectIsNotAnInteger() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_integerTypeMatchesIntegers_anObjectIsNotAnInteger" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"type":"integer"} + """, + false, + """integer type matches integers -> an object is not an integer""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "integer type matches integers -> an array is not an integer" + */ + @Test + fun type_integerTypeMatchesIntegers_anArrayIsNotAnInteger() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_integerTypeMatchesIntegers_anArrayIsNotAnInteger" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"type":"integer"} + """, + false, + """integer type matches integers -> an array is not an integer""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "integer type matches integers -> a boolean is not an integer" + */ + @Test + fun type_integerTypeMatchesIntegers_aBooleanIsNotAnInteger() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_integerTypeMatchesIntegers_aBooleanIsNotAnInteger" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"type":"integer"} + """, + false, + """integer type matches integers -> a boolean is not an integer""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "integer type matches integers -> null is not an integer" + */ + @Test + fun type_integerTypeMatchesIntegers_nullIsNotAnInteger() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_integerTypeMatchesIntegers_nullIsNotAnInteger" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"type":"integer"} + """, + false, + """integer type matches integers -> null is not an integer""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "number type matches numbers -> an integer is a number" + */ + @Test + fun type_numberTypeMatchesNumbers_anIntegerIsANumber() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_numberTypeMatchesNumbers_anIntegerIsANumber" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"type":"number"} + """, + true, + """number type matches numbers -> an integer is a number""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "number type matches numbers -> a float with zero fractional part is a number (and an integer)" + */ + @Test + fun type_numberTypeMatchesNumbers_aFloatWithZeroFractionalPartIsANumber_andAnInteger_() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_numberTypeMatchesNumbers_aFloatWithZeroFractionalPartIsANumber_andAnInteger_" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.0 + """, + """ + {"type":"number"} + """, + true, + """number type matches numbers -> a float with zero fractional part is a number (and an integer)""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "number type matches numbers -> a float is a number" + */ + @Test + fun type_numberTypeMatchesNumbers_aFloatIsANumber() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_numberTypeMatchesNumbers_aFloatIsANumber" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.1 + """, + """ + {"type":"number"} + """, + true, + """number type matches numbers -> a float is a number""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "number type matches numbers -> a string is not a number" + */ + @Test + fun type_numberTypeMatchesNumbers_aStringIsNotANumber() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_numberTypeMatchesNumbers_aStringIsNotANumber" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":"number"} + """, + false, + """number type matches numbers -> a string is not a number""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "number type matches numbers -> a string is still not a number, even if it looks like one" + */ + @Test + fun type_numberTypeMatchesNumbers_aStringIsStillNotANumber_EvenIfItLooksLikeOne() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_numberTypeMatchesNumbers_aStringIsStillNotANumber_EvenIfItLooksLikeOne" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "1" + """, + """ + {"type":"number"} + """, + false, + """number type matches numbers -> a string is still not a number, even if it looks like one""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "number type matches numbers -> an object is not a number" + */ + @Test + fun type_numberTypeMatchesNumbers_anObjectIsNotANumber() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_numberTypeMatchesNumbers_anObjectIsNotANumber" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"type":"number"} + """, + false, + """number type matches numbers -> an object is not a number""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "number type matches numbers -> an array is not a number" + */ + @Test + fun type_numberTypeMatchesNumbers_anArrayIsNotANumber() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_numberTypeMatchesNumbers_anArrayIsNotANumber" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"type":"number"} + """, + false, + """number type matches numbers -> an array is not a number""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "number type matches numbers -> a boolean is not a number" + */ + @Test + fun type_numberTypeMatchesNumbers_aBooleanIsNotANumber() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_numberTypeMatchesNumbers_aBooleanIsNotANumber" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"type":"number"} + """, + false, + """number type matches numbers -> a boolean is not a number""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "number type matches numbers -> null is not a number" + */ + @Test + fun type_numberTypeMatchesNumbers_nullIsNotANumber() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_numberTypeMatchesNumbers_nullIsNotANumber" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"type":"number"} + """, + false, + """number type matches numbers -> null is not a number""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "string type matches strings -> 1 is not a string" + */ + @Test + fun type_stringTypeMatchesStrings_1IsNotAString() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_stringTypeMatchesStrings_1IsNotAString" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"type":"string"} + """, + false, + """string type matches strings -> 1 is not a string""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "string type matches strings -> a float is not a string" + */ + @Test + fun type_stringTypeMatchesStrings_aFloatIsNotAString() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_stringTypeMatchesStrings_aFloatIsNotAString" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.1 + """, + """ + {"type":"string"} + """, + false, + """string type matches strings -> a float is not a string""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "string type matches strings -> a string is a string" + */ + @Test + fun type_stringTypeMatchesStrings_aStringIsAString() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_stringTypeMatchesStrings_aStringIsAString" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":"string"} + """, + true, + """string type matches strings -> a string is a string""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "string type matches strings -> a string is still a string, even if it looks like a number" + */ + @Test + fun type_stringTypeMatchesStrings_aStringIsStillAString_EvenIfItLooksLikeANumber() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_stringTypeMatchesStrings_aStringIsStillAString_EvenIfItLooksLikeANumber" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "1" + """, + """ + {"type":"string"} + """, + true, + """string type matches strings -> a string is still a string, even if it looks like a number""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "string type matches strings -> an empty string is still a string" + */ + @Test + fun type_stringTypeMatchesStrings_anEmptyStringIsStillAString() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_stringTypeMatchesStrings_anEmptyStringIsStillAString" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "" + """, + """ + {"type":"string"} + """, + true, + """string type matches strings -> an empty string is still a string""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "string type matches strings -> an object is not a string" + */ + @Test + fun type_stringTypeMatchesStrings_anObjectIsNotAString() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_stringTypeMatchesStrings_anObjectIsNotAString" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"type":"string"} + """, + false, + """string type matches strings -> an object is not a string""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "string type matches strings -> an array is not a string" + */ + @Test + fun type_stringTypeMatchesStrings_anArrayIsNotAString() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_stringTypeMatchesStrings_anArrayIsNotAString" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"type":"string"} + """, + false, + """string type matches strings -> an array is not a string""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "string type matches strings -> a boolean is not a string" + */ + @Test + fun type_stringTypeMatchesStrings_aBooleanIsNotAString() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_stringTypeMatchesStrings_aBooleanIsNotAString" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"type":"string"} + """, + false, + """string type matches strings -> a boolean is not a string""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "string type matches strings -> null is not a string" + */ + @Test + fun type_stringTypeMatchesStrings_nullIsNotAString() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_stringTypeMatchesStrings_nullIsNotAString" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"type":"string"} + """, + false, + """string type matches strings -> null is not a string""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "object type matches objects -> an integer is not an object" + */ + @Test + fun type_objectTypeMatchesObjects_anIntegerIsNotAnObject() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_objectTypeMatchesObjects_anIntegerIsNotAnObject" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"type":"object"} + """, + false, + """object type matches objects -> an integer is not an object""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "object type matches objects -> a float is not an object" + */ + @Test + fun type_objectTypeMatchesObjects_aFloatIsNotAnObject() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_objectTypeMatchesObjects_aFloatIsNotAnObject" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.1 + """, + """ + {"type":"object"} + """, + false, + """object type matches objects -> a float is not an object""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "object type matches objects -> a string is not an object" + */ + @Test + fun type_objectTypeMatchesObjects_aStringIsNotAnObject() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_objectTypeMatchesObjects_aStringIsNotAnObject" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":"object"} + """, + false, + """object type matches objects -> a string is not an object""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "object type matches objects -> an object is an object" + */ + @Test + fun type_objectTypeMatchesObjects_anObjectIsAnObject() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_objectTypeMatchesObjects_anObjectIsAnObject" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"type":"object"} + """, + true, + """object type matches objects -> an object is an object""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "object type matches objects -> an array is not an object" + */ + @Test + fun type_objectTypeMatchesObjects_anArrayIsNotAnObject() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_objectTypeMatchesObjects_anArrayIsNotAnObject" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"type":"object"} + """, + false, + """object type matches objects -> an array is not an object""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "object type matches objects -> a boolean is not an object" + */ + @Test + fun type_objectTypeMatchesObjects_aBooleanIsNotAnObject() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_objectTypeMatchesObjects_aBooleanIsNotAnObject" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"type":"object"} + """, + false, + """object type matches objects -> a boolean is not an object""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "object type matches objects -> null is not an object" + */ + @Test + fun type_objectTypeMatchesObjects_nullIsNotAnObject() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_objectTypeMatchesObjects_nullIsNotAnObject" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"type":"object"} + """, + false, + """object type matches objects -> null is not an object""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "array type matches arrays -> an integer is not an array" + */ + @Test + fun type_arrayTypeMatchesArrays_anIntegerIsNotAnArray() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_arrayTypeMatchesArrays_anIntegerIsNotAnArray" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"type":"array"} + """, + false, + """array type matches arrays -> an integer is not an array""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "array type matches arrays -> a float is not an array" + */ + @Test + fun type_arrayTypeMatchesArrays_aFloatIsNotAnArray() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_arrayTypeMatchesArrays_aFloatIsNotAnArray" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.1 + """, + """ + {"type":"array"} + """, + false, + """array type matches arrays -> a float is not an array""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "array type matches arrays -> a string is not an array" + */ + @Test + fun type_arrayTypeMatchesArrays_aStringIsNotAnArray() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_arrayTypeMatchesArrays_aStringIsNotAnArray" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":"array"} + """, + false, + """array type matches arrays -> a string is not an array""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "array type matches arrays -> an object is not an array" + */ + @Test + fun type_arrayTypeMatchesArrays_anObjectIsNotAnArray() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_arrayTypeMatchesArrays_anObjectIsNotAnArray" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"type":"array"} + """, + false, + """array type matches arrays -> an object is not an array""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "array type matches arrays -> an array is an array" + */ + @Test + fun type_arrayTypeMatchesArrays_anArrayIsAnArray() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_arrayTypeMatchesArrays_anArrayIsAnArray" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"type":"array"} + """, + true, + """array type matches arrays -> an array is an array""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "array type matches arrays -> a boolean is not an array" + */ + @Test + fun type_arrayTypeMatchesArrays_aBooleanIsNotAnArray() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_arrayTypeMatchesArrays_aBooleanIsNotAnArray" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"type":"array"} + """, + false, + """array type matches arrays -> a boolean is not an array""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "array type matches arrays -> null is not an array" + */ + @Test + fun type_arrayTypeMatchesArrays_nullIsNotAnArray() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_arrayTypeMatchesArrays_nullIsNotAnArray" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"type":"array"} + """, + false, + """array type matches arrays -> null is not an array""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "boolean type matches booleans -> an integer is not a boolean" + */ + @Test + fun type_booleanTypeMatchesBooleans_anIntegerIsNotABoolean() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_booleanTypeMatchesBooleans_anIntegerIsNotABoolean" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"type":"boolean"} + """, + false, + """boolean type matches booleans -> an integer is not a boolean""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "boolean type matches booleans -> zero is not a boolean" + */ + @Test + fun type_booleanTypeMatchesBooleans_zeroIsNotABoolean() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_booleanTypeMatchesBooleans_zeroIsNotABoolean" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0 + """, + """ + {"type":"boolean"} + """, + false, + """boolean type matches booleans -> zero is not a boolean""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "boolean type matches booleans -> a float is not a boolean" + */ + @Test + fun type_booleanTypeMatchesBooleans_aFloatIsNotABoolean() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_booleanTypeMatchesBooleans_aFloatIsNotABoolean" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.1 + """, + """ + {"type":"boolean"} + """, + false, + """boolean type matches booleans -> a float is not a boolean""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "boolean type matches booleans -> a string is not a boolean" + */ + @Test + fun type_booleanTypeMatchesBooleans_aStringIsNotABoolean() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_booleanTypeMatchesBooleans_aStringIsNotABoolean" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":"boolean"} + """, + false, + """boolean type matches booleans -> a string is not a boolean""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "boolean type matches booleans -> an empty string is not a boolean" + */ + @Test + fun type_booleanTypeMatchesBooleans_anEmptyStringIsNotABoolean() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_booleanTypeMatchesBooleans_anEmptyStringIsNotABoolean" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "" + """, + """ + {"type":"boolean"} + """, + false, + """boolean type matches booleans -> an empty string is not a boolean""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "boolean type matches booleans -> an object is not a boolean" + */ + @Test + fun type_booleanTypeMatchesBooleans_anObjectIsNotABoolean() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_booleanTypeMatchesBooleans_anObjectIsNotABoolean" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"type":"boolean"} + """, + false, + """boolean type matches booleans -> an object is not a boolean""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "boolean type matches booleans -> an array is not a boolean" + */ + @Test + fun type_booleanTypeMatchesBooleans_anArrayIsNotABoolean() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_booleanTypeMatchesBooleans_anArrayIsNotABoolean" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"type":"boolean"} + """, + false, + """boolean type matches booleans -> an array is not a boolean""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "boolean type matches booleans -> true is a boolean" + */ + @Test + fun type_booleanTypeMatchesBooleans_trueIsABoolean() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_booleanTypeMatchesBooleans_trueIsABoolean" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"type":"boolean"} + """, + true, + """boolean type matches booleans -> true is a boolean""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "boolean type matches booleans -> false is a boolean" + */ + @Test + fun type_booleanTypeMatchesBooleans_falseIsABoolean() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_booleanTypeMatchesBooleans_falseIsABoolean" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"type":"boolean"} + """, + true, + """boolean type matches booleans -> false is a boolean""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "boolean type matches booleans -> null is not a boolean" + */ + @Test + fun type_booleanTypeMatchesBooleans_nullIsNotABoolean() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_booleanTypeMatchesBooleans_nullIsNotABoolean" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"type":"boolean"} + """, + false, + """boolean type matches booleans -> null is not a boolean""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "null type matches only the null object -> an integer is not null" + */ + @Test + fun type_nullTypeMatchesOnlyTheNullObject_anIntegerIsNotNull() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_nullTypeMatchesOnlyTheNullObject_anIntegerIsNotNull" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"type":"null"} + """, + false, + """null type matches only the null object -> an integer is not null""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "null type matches only the null object -> a float is not null" + */ + @Test + fun type_nullTypeMatchesOnlyTheNullObject_aFloatIsNotNull() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_nullTypeMatchesOnlyTheNullObject_aFloatIsNotNull" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.1 + """, + """ + {"type":"null"} + """, + false, + """null type matches only the null object -> a float is not null""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "null type matches only the null object -> zero is not null" + */ + @Test + fun type_nullTypeMatchesOnlyTheNullObject_zeroIsNotNull() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_nullTypeMatchesOnlyTheNullObject_zeroIsNotNull" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 0 + """, + """ + {"type":"null"} + """, + false, + """null type matches only the null object -> zero is not null""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "null type matches only the null object -> a string is not null" + */ + @Test + fun type_nullTypeMatchesOnlyTheNullObject_aStringIsNotNull() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_nullTypeMatchesOnlyTheNullObject_aStringIsNotNull" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":"null"} + """, + false, + """null type matches only the null object -> a string is not null""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "null type matches only the null object -> an empty string is not null" + */ + @Test + fun type_nullTypeMatchesOnlyTheNullObject_anEmptyStringIsNotNull() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_nullTypeMatchesOnlyTheNullObject_anEmptyStringIsNotNull" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "" + """, + """ + {"type":"null"} + """, + false, + """null type matches only the null object -> an empty string is not null""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "null type matches only the null object -> an object is not null" + */ + @Test + fun type_nullTypeMatchesOnlyTheNullObject_anObjectIsNotNull() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_nullTypeMatchesOnlyTheNullObject_anObjectIsNotNull" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"type":"null"} + """, + false, + """null type matches only the null object -> an object is not null""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "null type matches only the null object -> an array is not null" + */ + @Test + fun type_nullTypeMatchesOnlyTheNullObject_anArrayIsNotNull() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_nullTypeMatchesOnlyTheNullObject_anArrayIsNotNull" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"type":"null"} + """, + false, + """null type matches only the null object -> an array is not null""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "null type matches only the null object -> true is not null" + */ + @Test + fun type_nullTypeMatchesOnlyTheNullObject_trueIsNotNull() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_nullTypeMatchesOnlyTheNullObject_trueIsNotNull" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"type":"null"} + """, + false, + """null type matches only the null object -> true is not null""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "null type matches only the null object -> false is not null" + */ + @Test + fun type_nullTypeMatchesOnlyTheNullObject_falseIsNotNull() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_nullTypeMatchesOnlyTheNullObject_falseIsNotNull" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + false + """, + """ + {"type":"null"} + """, + false, + """null type matches only the null object -> false is not null""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "null type matches only the null object -> null is null" + */ + @Test + fun type_nullTypeMatchesOnlyTheNullObject_nullIsNull() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_nullTypeMatchesOnlyTheNullObject_nullIsNull" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"type":"null"} + """, + true, + """null type matches only the null object -> null is null""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "multiple types can be specified in an array -> an integer is valid" + */ + @Test + fun type_multipleTypesCanBeSpecifiedInAnArray_anIntegerIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_multipleTypesCanBeSpecifiedInAnArray_anIntegerIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1 + """, + """ + {"type":["integer","string"]} + """, + true, + """multiple types can be specified in an array -> an integer is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "multiple types can be specified in an array -> a string is valid" + */ + @Test + fun type_multipleTypesCanBeSpecifiedInAnArray_aStringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_multipleTypesCanBeSpecifiedInAnArray_aStringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":["integer","string"]} + """, + true, + """multiple types can be specified in an array -> a string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "multiple types can be specified in an array -> a float is invalid" + */ + @Test + fun type_multipleTypesCanBeSpecifiedInAnArray_aFloatIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_multipleTypesCanBeSpecifiedInAnArray_aFloatIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 1.1 + """, + """ + {"type":["integer","string"]} + """, + false, + """multiple types can be specified in an array -> a float is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "multiple types can be specified in an array -> an object is invalid" + */ + @Test + fun type_multipleTypesCanBeSpecifiedInAnArray_anObjectIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_multipleTypesCanBeSpecifiedInAnArray_anObjectIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {} + """, + """ + {"type":["integer","string"]} + """, + false, + """multiple types can be specified in an array -> an object is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "multiple types can be specified in an array -> an array is invalid" + */ + @Test + fun type_multipleTypesCanBeSpecifiedInAnArray_anArrayIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_multipleTypesCanBeSpecifiedInAnArray_anArrayIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [] + """, + """ + {"type":["integer","string"]} + """, + false, + """multiple types can be specified in an array -> an array is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "multiple types can be specified in an array -> a boolean is invalid" + */ + @Test + fun type_multipleTypesCanBeSpecifiedInAnArray_aBooleanIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_multipleTypesCanBeSpecifiedInAnArray_aBooleanIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + true + """, + """ + {"type":["integer","string"]} + """, + false, + """multiple types can be specified in an array -> a boolean is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "multiple types can be specified in an array -> null is invalid" + */ + @Test + fun type_multipleTypesCanBeSpecifiedInAnArray_nullIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_multipleTypesCanBeSpecifiedInAnArray_nullIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"type":["integer","string"]} + """, + false, + """multiple types can be specified in an array -> null is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "type as array with one item -> string is valid" + */ + @Test + fun type_typeAsArrayWithOneItem_stringIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_typeAsArrayWithOneItem_stringIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":["string"]} + """, + true, + """type as array with one item -> string is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "type as array with one item -> number is invalid" + */ + @Test + fun type_typeAsArrayWithOneItem_numberIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_typeAsArrayWithOneItem_numberIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 123 + """, + """ + {"type":["string"]} + """, + false, + """type as array with one item -> number is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "type: array or object -> array is valid" + */ + @Test + fun type_type_ArrayOrObject_arrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_type_ArrayOrObject_arrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3] + """, + """ + {"type":["array","object"]} + """, + true, + """type: array or object -> array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "type: array or object -> object is valid" + */ + @Test + fun type_type_ArrayOrObject_objectIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_type_ArrayOrObject_objectIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":123} + """, + """ + {"type":["array","object"]} + """, + true, + """type: array or object -> object is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "type: array or object -> number is invalid" + */ + @Test + fun type_type_ArrayOrObject_numberIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_type_ArrayOrObject_numberIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 123 + """, + """ + {"type":["array","object"]} + """, + false, + """type: array or object -> number is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "type: array or object -> string is invalid" + */ + @Test + fun type_type_ArrayOrObject_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_type_ArrayOrObject_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":["array","object"]} + """, + false, + """type: array or object -> string is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "type: array or object -> null is invalid" + */ + @Test + fun type_type_ArrayOrObject_nullIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_type_ArrayOrObject_nullIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"type":["array","object"]} + """, + false, + """type: array or object -> null is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "type: array, object or null -> array is valid" + */ + @Test + fun type_type_Array_ObjectOrNull_arrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_type_Array_ObjectOrNull_arrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,3] + """, + """ + {"type":["array","object","null"]} + """, + true, + """type: array, object or null -> array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "type: array, object or null -> object is valid" + */ + @Test + fun type_type_Array_ObjectOrNull_objectIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_type_Array_ObjectOrNull_objectIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + {"foo":123} + """, + """ + {"type":["array","object","null"]} + """, + true, + """type: array, object or null -> object is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "type: array, object or null -> null is valid" + */ + @Test + fun type_type_Array_ObjectOrNull_nullIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_type_Array_ObjectOrNull_nullIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + null + """, + """ + {"type":["array","object","null"]} + """, + true, + """type: array, object or null -> null is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "type: array, object or null -> number is invalid" + */ + @Test + fun type_type_Array_ObjectOrNull_numberIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_type_Array_ObjectOrNull_numberIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + 123 + """, + """ + {"type":["array","object","null"]} + """, + false, + """type: array, object or null -> number is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/type.json`: + * "type: array, object or null -> string is invalid" + */ + @Test + fun type_type_Array_ObjectOrNull_stringIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "type_type_Array_ObjectOrNull_stringIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + "foo" + """, + """ + {"type":["array","object","null"]} + """, + false, + """type: array, object or null -> string is invalid""") + } + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> unique array of integers is valid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_uniqueArrayOfIntegersIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_uniqueArrayOfIntegersIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> unique array of integers is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> non-unique array of integers is invalid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_non_uniqueArrayOfIntegersIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfIntegersIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,1] + """, + """ + {"uniqueItems":true} + """, + false, + """uniqueItems validation -> non-unique array of integers is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> non-unique array of more than two integers is invalid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_non_uniqueArrayOfMoreThanTwoIntegersIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfMoreThanTwoIntegersIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2,1] + """, + """ + {"uniqueItems":true} + """, + false, + """uniqueItems validation -> non-unique array of more than two integers is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> numbers are unique if mathematically unequal" + */ + @Test + fun uniqueItems_uniqueItemsValidation_numbersAreUniqueIfMathematicallyUnequal() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_numbersAreUniqueIfMathematicallyUnequal" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1.0,1.00,1] + """, + """ + {"uniqueItems":true} + """, + false, + """uniqueItems validation -> numbers are unique if mathematically unequal""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> false is not equal to zero" + */ + @Test + fun uniqueItems_uniqueItemsValidation_falseIsNotEqualToZero() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_falseIsNotEqualToZero" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [0,false] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> false is not equal to zero""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> true is not equal to one" + */ + @Test + fun uniqueItems_uniqueItemsValidation_trueIsNotEqualToOne() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_trueIsNotEqualToOne" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,true] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> true is not equal to one""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> unique array of strings is valid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_uniqueArrayOfStringsIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_uniqueArrayOfStringsIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["foo","bar","baz"] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> unique array of strings is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> non-unique array of strings is invalid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_non_uniqueArrayOfStringsIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfStringsIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + ["foo","bar","foo"] + """, + """ + {"uniqueItems":true} + """, + false, + """uniqueItems validation -> non-unique array of strings is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> unique array of objects is valid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_uniqueArrayOfObjectsIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_uniqueArrayOfObjectsIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"foo":"bar"},{"foo":"baz"}] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> unique array of objects is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> non-unique array of objects is invalid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_non_uniqueArrayOfObjectsIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfObjectsIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"foo":"bar"},{"foo":"bar"}] + """, + """ + {"uniqueItems":true} + """, + false, + """uniqueItems validation -> non-unique array of objects is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> property order of array of objects is ignored" + */ + @Test + fun uniqueItems_uniqueItemsValidation_propertyOrderOfArrayOfObjectsIsIgnored() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_propertyOrderOfArrayOfObjectsIsIgnored" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"foo":"bar","bar":"foo"},{"bar":"foo","foo":"bar"}] + """, + """ + {"uniqueItems":true} + """, + false, + """uniqueItems validation -> property order of array of objects is ignored""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> unique array of nested objects is valid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_uniqueArrayOfNestedObjectsIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_uniqueArrayOfNestedObjectsIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"foo":{"bar":{"baz":true}}},{"foo":{"bar":{"baz":false}}}] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> unique array of nested objects is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> non-unique array of nested objects is invalid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_non_uniqueArrayOfNestedObjectsIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfNestedObjectsIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"foo":{"bar":{"baz":true}}},{"foo":{"bar":{"baz":true}}}] + """, + """ + {"uniqueItems":true} + """, + false, + """uniqueItems validation -> non-unique array of nested objects is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> unique array of arrays is valid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_uniqueArrayOfArraysIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_uniqueArrayOfArraysIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [["foo"],["bar"]] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> unique array of arrays is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> non-unique array of arrays is invalid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_non_uniqueArrayOfArraysIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfArraysIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [["foo"],["foo"]] + """, + """ + {"uniqueItems":true} + """, + false, + """uniqueItems validation -> non-unique array of arrays is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> non-unique array of more than two arrays is invalid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_non_uniqueArrayOfMoreThanTwoArraysIsInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_non_uniqueArrayOfMoreThanTwoArraysIsInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [["foo"],["bar"],["foo"]] + """, + """ + {"uniqueItems":true} + """, + false, + """uniqueItems validation -> non-unique array of more than two arrays is invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> 1 and true are unique" + */ + @Test + fun uniqueItems_uniqueItemsValidation_1AndTrueAreUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_1AndTrueAreUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,true] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> 1 and true are unique""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> 0 and false are unique" + */ + @Test + fun uniqueItems_uniqueItemsValidation_0AndFalseAreUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_0AndFalseAreUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [0,false] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> 0 and false are unique""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> [1] and [true] are unique" + */ + @Test + fun uniqueItems_uniqueItemsValidation__1_And_true_AreUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation__1_And_true_AreUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[1],[true]] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> [1] and [true] are unique""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> [0] and [false] are unique" + */ + @Test + fun uniqueItems_uniqueItemsValidation__0_And_false_AreUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation__0_And_false_AreUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[0],[false]] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> [0] and [false] are unique""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> nested [1] and [true] are unique" + */ + @Test + fun uniqueItems_uniqueItemsValidation_nested_1_And_true_AreUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_nested_1_And_true_AreUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[[1],"foo"],[[true],"foo"]] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> nested [1] and [true] are unique""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> nested [0] and [false] are unique" + */ + @Test + fun uniqueItems_uniqueItemsValidation_nested_0_And_false_AreUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_nested_0_And_false_AreUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [[[0],"foo"],[[false],"foo"]] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> nested [0] and [false] are unique""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> unique heterogeneous types are valid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_uniqueHeterogeneousTypesAreValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_uniqueHeterogeneousTypesAreValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{},[1],true,null,1,"{}"] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> unique heterogeneous types are valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> non-unique heterogeneous types are invalid" + */ + @Test + fun uniqueItems_uniqueItemsValidation_non_uniqueHeterogeneousTypesAreInvalid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_non_uniqueHeterogeneousTypesAreInvalid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{},[1],true,null,{},1] + """, + """ + {"uniqueItems":true} + """, + false, + """uniqueItems validation -> non-unique heterogeneous types are invalid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> different objects are unique" + */ + @Test + fun uniqueItems_uniqueItemsValidation_differentObjectsAreUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_differentObjectsAreUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"a":1,"b":2},{"a":2,"b":1}] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> different objects are unique""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> objects are non-unique despite key order" + */ + @Test + fun uniqueItems_uniqueItemsValidation_objectsAreNon_uniqueDespiteKeyOrder() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation_objectsAreNon_uniqueDespiteKeyOrder" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"a":1,"b":2},{"b":2,"a":1}] + """, + """ + {"uniqueItems":true} + """, + false, + """uniqueItems validation -> objects are non-unique despite key order""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> {"a": false} and {"a": 0} are unique" + */ + @Test + fun uniqueItems_uniqueItemsValidation___a__False_And__a__0_AreUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation___a__False_And__a__0_AreUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"a":false},{"a":0}] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> {"a": false} and {"a": 0} are unique""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems validation -> {"a": true} and {"a": 1} are unique" + */ + @Test + fun uniqueItems_uniqueItemsValidation___a__True_And__a__1_AreUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsValidation___a__True_And__a__1_AreUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"a":true},{"a":1}] + """, + """ + {"uniqueItems":true} + """, + true, + """uniqueItems validation -> {"a": true} and {"a": 1} are unique""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items -> [false, true] from items array is valid" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItems__false_True_FromItemsArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItems__false_True_FromItemsArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,true] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true} + """, + true, + """uniqueItems with an array of items -> [false, true] from items array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items -> [true, false] from items array is valid" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItems__true_False_FromItemsArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItems__true_False_FromItemsArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true,false] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true} + """, + true, + """uniqueItems with an array of items -> [true, false] from items array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items -> [false, false] from items array is not valid" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItems__false_False_FromItemsArrayIsNotValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItems__false_False_FromItemsArrayIsNotValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,false] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true} + """, + false, + """uniqueItems with an array of items -> [false, false] from items array is not valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items -> [true, true] from items array is not valid" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItems__true_True_FromItemsArrayIsNotValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItems__true_True_FromItemsArrayIsNotValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true,true] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true} + """, + false, + """uniqueItems with an array of items -> [true, true] from items array is not valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items -> unique array extended from [false, true] is valid" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItems_uniqueArrayExtendedFrom_false_True_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItems_uniqueArrayExtendedFrom_false_True_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,true,"foo","bar"] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true} + """, + true, + """uniqueItems with an array of items -> unique array extended from [false, true] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items -> unique array extended from [true, false] is valid" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItems_uniqueArrayExtendedFrom_true_False_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItems_uniqueArrayExtendedFrom_true_False_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true,false,"foo","bar"] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true} + """, + true, + """uniqueItems with an array of items -> unique array extended from [true, false] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items -> non-unique array extended from [false, true] is not valid" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItems_non_uniqueArrayExtendedFrom_false_True_IsNotValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItems_non_uniqueArrayExtendedFrom_false_True_IsNotValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,true,"foo","foo"] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true} + """, + false, + """uniqueItems with an array of items -> non-unique array extended from [false, true] is not valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items -> non-unique array extended from [true, false] is not valid" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItems_non_uniqueArrayExtendedFrom_true_False_IsNotValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItems_non_uniqueArrayExtendedFrom_true_False_IsNotValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true,false,"foo","foo"] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true} + """, + false, + """uniqueItems with an array of items -> non-unique array extended from [true, false] is not valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items and additionalItems=false -> [false, true] from items array is valid" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false__false_True_FromItemsArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false__false_True_FromItemsArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,true] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true,"additionalItems":false} + """, + true, + """uniqueItems with an array of items and additionalItems=false -> [false, true] from items array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items and additionalItems=false -> [true, false] from items array is valid" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false__true_False_FromItemsArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false__true_False_FromItemsArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true,false] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true,"additionalItems":false} + """, + true, + """uniqueItems with an array of items and additionalItems=false -> [true, false] from items array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items and additionalItems=false -> [false, false] from items array is not valid" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false__false_False_FromItemsArrayIsNotValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false__false_False_FromItemsArrayIsNotValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,false] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true,"additionalItems":false} + """, + false, + """uniqueItems with an array of items and additionalItems=false -> [false, false] from items array is not valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items and additionalItems=false -> [true, true] from items array is not valid" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false__true_True_FromItemsArrayIsNotValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false__true_True_FromItemsArrayIsNotValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true,true] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true,"additionalItems":false} + """, + false, + """uniqueItems with an array of items and additionalItems=false -> [true, true] from items array is not valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems with an array of items and additionalItems=false -> extra items are invalid even if unique" + */ + @Test + fun uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false_extraItemsAreInvalidEvenIfUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItemsWithAnArrayOfItemsAndAdditionalItems_false_extraItemsAreInvalidEvenIfUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,true,null] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":true,"additionalItems":false} + """, + false, + """uniqueItems with an array of items and additionalItems=false -> extra items are invalid even if unique""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> unique array of integers is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_uniqueArrayOfIntegersIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_uniqueArrayOfIntegersIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,2] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> unique array of integers is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> non-unique array of integers is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_non_uniqueArrayOfIntegersIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_non_uniqueArrayOfIntegersIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,1] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> non-unique array of integers is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> numbers are unique if mathematically unequal" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_numbersAreUniqueIfMathematicallyUnequal() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_numbersAreUniqueIfMathematicallyUnequal" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1.0,1.00,1] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> numbers are unique if mathematically unequal""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> false is not equal to zero" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_falseIsNotEqualToZero() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_falseIsNotEqualToZero" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [0,false] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> false is not equal to zero""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> true is not equal to one" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_trueIsNotEqualToOne() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_trueIsNotEqualToOne" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,true] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> true is not equal to one""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> unique array of objects is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_uniqueArrayOfObjectsIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_uniqueArrayOfObjectsIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"foo":"bar"},{"foo":"baz"}] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> unique array of objects is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> non-unique array of objects is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_non_uniqueArrayOfObjectsIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_non_uniqueArrayOfObjectsIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"foo":"bar"},{"foo":"bar"}] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> non-unique array of objects is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> unique array of nested objects is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_uniqueArrayOfNestedObjectsIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_uniqueArrayOfNestedObjectsIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"foo":{"bar":{"baz":true}}},{"foo":{"bar":{"baz":false}}}] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> unique array of nested objects is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> non-unique array of nested objects is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_non_uniqueArrayOfNestedObjectsIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_non_uniqueArrayOfNestedObjectsIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{"foo":{"bar":{"baz":true}}},{"foo":{"bar":{"baz":true}}}] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> non-unique array of nested objects is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> unique array of arrays is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_uniqueArrayOfArraysIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_uniqueArrayOfArraysIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [["foo"],["bar"]] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> unique array of arrays is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> non-unique array of arrays is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_non_uniqueArrayOfArraysIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_non_uniqueArrayOfArraysIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [["foo"],["foo"]] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> non-unique array of arrays is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> 1 and true are unique" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_1AndTrueAreUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_1AndTrueAreUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [1,true] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> 1 and true are unique""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> 0 and false are unique" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_0AndFalseAreUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_0AndFalseAreUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [0,false] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> 0 and false are unique""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> unique heterogeneous types are valid" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_uniqueHeterogeneousTypesAreValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_uniqueHeterogeneousTypesAreValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{},[1],true,null,1] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> unique heterogeneous types are valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false validation -> non-unique heterogeneous types are valid" + */ + @Test + fun uniqueItems_uniqueItems_falseValidation_non_uniqueHeterogeneousTypesAreValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseValidation_non_uniqueHeterogeneousTypesAreValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [{},[1],true,null,{},1] + """, + """ + {"uniqueItems":false} + """, + true, + """uniqueItems=false validation -> non-unique heterogeneous types are valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items -> [false, true] from items array is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItems__false_True_FromItemsArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItems__false_True_FromItemsArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,true] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false} + """, + true, + """uniqueItems=false with an array of items -> [false, true] from items array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items -> [true, false] from items array is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItems__true_False_FromItemsArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItems__true_False_FromItemsArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true,false] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false} + """, + true, + """uniqueItems=false with an array of items -> [true, false] from items array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items -> [false, false] from items array is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItems__false_False_FromItemsArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItems__false_False_FromItemsArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,false] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false} + """, + true, + """uniqueItems=false with an array of items -> [false, false] from items array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items -> [true, true] from items array is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItems__true_True_FromItemsArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItems__true_True_FromItemsArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true,true] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false} + """, + true, + """uniqueItems=false with an array of items -> [true, true] from items array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items -> unique array extended from [false, true] is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItems_uniqueArrayExtendedFrom_false_True_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItems_uniqueArrayExtendedFrom_false_True_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,true,"foo","bar"] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false} + """, + true, + """uniqueItems=false with an array of items -> unique array extended from [false, true] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items -> unique array extended from [true, false] is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItems_uniqueArrayExtendedFrom_true_False_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItems_uniqueArrayExtendedFrom_true_False_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true,false,"foo","bar"] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false} + """, + true, + """uniqueItems=false with an array of items -> unique array extended from [true, false] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items -> non-unique array extended from [false, true] is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItems_non_uniqueArrayExtendedFrom_false_True_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItems_non_uniqueArrayExtendedFrom_false_True_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,true,"foo","foo"] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false} + """, + true, + """uniqueItems=false with an array of items -> non-unique array extended from [false, true] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items -> non-unique array extended from [true, false] is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItems_non_uniqueArrayExtendedFrom_true_False_IsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItems_non_uniqueArrayExtendedFrom_true_False_IsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true,false,"foo","foo"] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false} + """, + true, + """uniqueItems=false with an array of items -> non-unique array extended from [true, false] is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items and additionalItems=false -> [false, true] from items array is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false__false_True_FromItemsArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false__false_True_FromItemsArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,true] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false,"additionalItems":false} + """, + true, + """uniqueItems=false with an array of items and additionalItems=false -> [false, true] from items array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items and additionalItems=false -> [true, false] from items array is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false__true_False_FromItemsArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false__true_False_FromItemsArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true,false] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false,"additionalItems":false} + """, + true, + """uniqueItems=false with an array of items and additionalItems=false -> [true, false] from items array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items and additionalItems=false -> [false, false] from items array is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false__false_False_FromItemsArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false__false_False_FromItemsArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,false] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false,"additionalItems":false} + """, + true, + """uniqueItems=false with an array of items and additionalItems=false -> [false, false] from items array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items and additionalItems=false -> [true, true] from items array is valid" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false__true_True_FromItemsArrayIsValid() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false__true_True_FromItemsArrayIsValid" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [true,true] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false,"additionalItems":false} + """, + true, + """uniqueItems=false with an array of items and additionalItems=false -> [true, true] from items array is valid""") + } + + /** + * Test generated by [org.kson.jsonsuite.JsonTestSuiteGenerator] based on `buildSrc/support/jsonsuite/JSON-Schema-Test-Suite/tests/draft7/uniqueItems.json`: + * "uniqueItems=false with an array of items and additionalItems=false -> extra items are invalid even if unique" + */ + @Test + fun uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false_extraItemsAreInvalidEvenIfUnique() { + /** + * TODO implement the schema functionality under test here and remove this exclusion from + * "uniqueItems_uniqueItems_falseWithAnArrayOfItemsAndAdditionalItems_false_extraItemsAreInvalidEvenIfUnique" from + * [org.kson.jsonsuite.schemaTestSuiteExclusions] + */ + return + assertKsonEnforcesSchema( + """ + [false,true,null] + """, + """ + {"items":[{"type":"boolean"},{"type":"boolean"}],"uniqueItems":false,"additionalItems":false} + """, + false, + """uniqueItems=false with an array of items and additionalItems=false -> extra items are invalid even if unique""") + } + + private fun assertKsonEnforcesSchema(ksonSource: String, + schemaJson: String, + shouldAcceptAsValid: Boolean, + description: String) { + // accepted as valid if and only if we parsed without error + val acceptedAsValid = !Kson.parse(ksonSource.trimIndent(), schemaJson.trimIndent()) + .hasErrors() + + assertEquals( + shouldAcceptAsValid, + acceptedAsValid, + description) + } +}