json-schema-org / JSON-Schema-Test-Suite

A language agnostic test suite for the JSON Schema specifications
MIT License
615 stars 205 forks source link

Tests for dependentSchema and propertyDependencies with unevaluatedPro… #732

Closed MeastroZI closed 5 months ago

MeastroZI commented 5 months ago

adding tests for dependentSchema and propertyDependencie with unevaluatedProperties and additionalProperties refer this issue #626

MeastroZI commented 5 months ago

Feww..! GREEN :)

gregsdennis commented 5 months ago

The files look fine, but I think we need more test cases for each scenario. What does a passing instance look like? What if the nested subschemas themselves do declare properties? Etc.

MeastroZI commented 5 months ago

Please review this

MeastroZI commented 5 months ago

The files look fine, but I think we need more test cases for each scenario. What does a passing instance look like? What if the nested subschemas themselves do declare properties? Etc.

Got it! I misunderstood the test cases as a test. I'm really sorry about that. If I understand correctly, I should add more test cases that cover the inner schemas as well. Are the test cases I added before your this comment still fine to keep?

MeastroZI commented 5 months ago

This one

{
        "description": "dependent schema with additionalProperties",
        "schema": {
            "$schema": "https://json-schema.org/draft/2019-09/schema",
            "dependentSchemas": {
                "foo": {}
            },
            "additionalProperties": false
        },
        "tests": [
            {
                "description": "dependentSchemas properties are counted as additional properties",
                "data": {
                    "foo": ""
                },
                "valid": false
            }
        ]
    }
gregsdennis commented 5 months ago

I misunderstood the test cases as a test.

No, you didn't misunderstand. What you have is good, except for the test cases I commented on. For those, we need schemas like the one I showed.

You'll also need to rebase this branch since I merged another PR.

MeastroZI commented 5 months ago

I just realize it after 5 commits that i can add the suggested changes in batch and then commit them in once :sweat_smile: , should i squash them into once ?