You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reference resolution does not understand schema structure #15
Both Walker::parseSchema and Walker::applyConstraints relies on constraints to corrently traverse the schema / instance. Walker::resolveReferences does not and therefore e.g. the following test fails
{
"title": "issue #15: References under unknown keywords should be ignored",
"tests": [
{
"title": "$ref in unknown property",
"schema": {
"unknown": {
"$ref": "#/foo"
}
},
"valid": [
{},
123
]
}
]
}
The possible solutions I can think of
Add new method to the Constraint interface which would work similarly to Constraint::normalize
Merge $ref resolution with the normalize phase, i.e. resolve references during normalize traversal
Extract the traversing logic from normalize to a new method, e.g. Constraint::getSubSchemas(). This may require increasing the required PHP version from 5.4 to 5.5 because of yield.
Possible implementations of ItemsConstraint::getSubSchemas.
Thanks for reporting this. The spec states that unknown should be ignored and that's indeed not the case in the resolution step. For now, I'm gonna go a different, simpler route to solve this but I take note of your suggestions for a post v1 implementation I have my mind on.
Activity
stefk commentedon Apr 24, 2016
Thanks for reporting this. The spec states that unknown should be ignored and that's indeed not the case in the resolution step. For now, I'm gonna go a different, simpler route to solve this but I take note of your suggestions for a post v1 implementation I have my mind on.
Ignore unknown keywords during reference resolution (closes #15)