Skip to content

Test for resolving references when there're other properties on schema #85

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
zaggino opened this issue Mar 3, 2015 · 4 comments
Closed

Comments

@zaggino
Copy link
Contributor

zaggino commented Mar 3, 2015

I'm missing a test here: https://github.com/json-schema/JSON-Schema-Test-Suite/blob/develop/tests/draft4/ref.json

var schemaA = {
    "id": "long-string",
    "type": "string",
    "maxLength": 4096
}
var schemaB = {
    "id": "person-object",
    "type": "object",
    "properties": {
        "name": {
            "$ref": "long-string",
            "maxLength": 10
        }
    }
}

does the result need to respect "maxLength": 10 or not?
does the result need to respect both maxLength's? (lets say if it was not maxLength but format which would make more sense) - should the validator copy but not override properties where $ref is, or should it be match all of properties and also all properties on reference

@samskiter
Copy link

"$ref" says "I am this thing" so your "maxLength": 10 should be ignored

@zaggino
Copy link
Contributor Author

zaggino commented Mar 3, 2015

but there's not a test for this, current state is do whatever you want :)

@Julian
Copy link
Member

Julian commented Apr 6, 2015

If there isn't sounds like a reasonable one to add. My vague recollection says I added one but I'll believe you if it's not there.

@epoberezkin
Copy link
Member

resolved by #142

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

4 participants