Skip to content

bug: unevaluatedProperties is not working properly #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AgniveshChaubey opened this issue Mar 13, 2024 · 1 comment
Closed

bug: unevaluatedProperties is not working properly #66

AgniveshChaubey opened this issue Mar 13, 2024 · 1 comment

Comments

@AgniveshChaubey
Copy link

I was reading #550 to understand the behavior of unevaluatedProperties and when testing the below example

image

on jsonschema.dev, I found that the validation result does not match what is expected by the example.

for this schema

{
    "title": "Vehicle",
    "type": "object",
    "oneOf": [
        {
            "title": "Car",
            "required": ["wheels", "headlights"],
            "properties": {
                "wheels": {},
                "headlights": {}
            }
        },
        {
            "title": "Boat",
            "required": ["pontoons"],
            "properties": {
                "pontoons": {}
            }   
        },  
        {
            "title": "Plane",
            "required": ["wings"],
            "properties": {
                "wings": {}
            }
        }
    ],
    "unevaluatedProperties": false
}

the instance { "headlights": {}, "pontoons": {} } should fail, but it is unexpectedly passing. (check this)

@Relequestual
Copy link
Owner

@AgniveshChaubey Thanks for reporting. You understand correctly, however right now it only supports draft-07, and not 2019-09 or 2020-12, so it will be treated as an unknown additional keyword, which is allowed and valid for draft-07.

There is a notice at the top which says the version supported is draft-07.

It would be nice if additional unknown keywords caused a warning, but that requires some work, which I don't currently have time for.

As such, I'm going to close this Issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants