-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
additionalProperties and $ref are not working together #185
Comments
Your second schema is actually invalid; see additionalProperties, properties, and patternProperties in draft4. The
In this case, I think you are looking for what draft3 provided via {
"type": "object",
"allOf": [
{ "$ref": "http://example.com/id.schema#" },
{
"type": "object",
"properties": { "name": { "type": "string" } }
}
]
} (Typed directly into github so forgive typos and such =) Btw, when developing schemas, it's typically helpful to always run them with Hope that helps! |
Thank you pd, I was taking a closer look and I think what I need is „$merge“ from the proposal v5.
If you have a branch for v5 I really would be some of the new tester. |
Yes, $merge would allow to model type hierarchies with reuse, I also missed that already. |
I don't believe there is anything set in stone. There was a push around May to get the draft out, but that apparently stalled. There also isn't much news on the roadmap for actual ratification beyond drafts... |
I don't think there would be any harm to defining a v5 schema in json-schema, but personally I wouldn't choose to spend any time on it until the draft is published.= |
Dito |
I have a schema file (Thing.schema) which is referencing to another file (ID.schema).
When I set inside of Thing.schema - "additionalProperties": false - at the top of the nest, the reference to the other schema file will not be resolved against the URI of the current schema. And so the error message is:
The property '#/' contains additional properties ["type"] outside of the schema when none are allowed in schema http://DOMAIN.com/Thing.schema#
ID.schema
ID data
Validation is correct on: ID against ID.schema
Error message: The property '#/' contains additional properties ["type"] outside of the schema when none are allowed in schema http://DOMAIN.com/Thing.schema#
Inside the draft explaination: http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.28 the URI should be resolved first and validated after. Or am I am wrong?
The text was updated successfully, but these errors were encountered: