Skip to content
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

anyOf validation failing if reference schema has additionalProperties property #38

Closed
marutha opened this issue Jan 11, 2017 · 2 comments

Comments

@marutha
Copy link

marutha commented Jan 11, 2017

{
    "title" : "Update Vehicle",
    "$schema" : "http://json-schema.org/draft-04/schema#",
    "id" : "post_vehicle.json",
    "type" : "object",
    "properties" : {
        "content" : {
            "type" : "object",
            "anyOf" : [
                {
                    "$ref" : "post_car.json"
                },
                {
                    "$ref" : "post_jet.json"
                }
            ]
        }
    },
    "required" : ["content"],
    "additionalProperties" : false
}

The post_car.json has the below

{
    "title" : "Update car",
    "$schema" : "http://json-schema.org/draft-04/schema#",
    "id" : "post_car.json",
    "type" : "object",
    "properties" : {
        "steering_type" : {
            "type" : "object",
            "properties" : .......
        }
...........
    },
    "additionalProperties" : false
}

The validation is failing with above and passing when I remove the below lines in post_car.json,

    "additionalProperties" : false

if I am right if the schema validation fails in post_car.json, it should process for post_jet.json, this behaviour is happening only when the above property "addtionalProperties" is present.

@andreineculau
Copy link
Member

@marutha thanks for the report, but please provide full examples of schemas + instance, along with the failing message

@marutha
Copy link
Author

marutha commented Jan 12, 2017

I will close this as of now

@marutha marutha closed this as completed Jan 12, 2017
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