-
-
Notifications
You must be signed in to change notification settings - Fork 219
Additional $ref tests for draft-04/06 #160
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
Changes from 1 commit
a884acc
0178c74
3186761
cbe0e5b
44f6447
671bad6
25836f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,5 +208,93 @@ | |
"valid": false | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "Recursive references between schemas", | ||
"schema": { | ||
"id": "http://localhost:1234/tree", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is draft 6 why is this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right :) will fix |
||
"description": "tree of nodes", | ||
"type": "object", | ||
"properties": { | ||
"meta": {"type": "string"}, | ||
"nodes": { | ||
"type": "array", | ||
"items": {"$ref": "node"} | ||
} | ||
}, | ||
"required": ["meta", "nodes"], | ||
"definitions": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see definitions used in this schema. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Relequestual it's the same test as above, just in draft6 folder - please see the comment above |
||
"node": { | ||
"id": "http://localhost:1234/node", | ||
"description": "node", | ||
"type": "object", | ||
"properties": { | ||
"value": {"type": "number"}, | ||
"subtree": {"$ref": "tree"} | ||
}, | ||
"required": ["value"] | ||
} | ||
} | ||
}, | ||
"tests": [ | ||
{ | ||
"description": "valid tree", | ||
"data": { | ||
"meta": "root", | ||
"nodes": [ | ||
{ | ||
"value": 1, | ||
"subtree": { | ||
"meta": "child", | ||
"nodes": [ | ||
{"value": 1.1}, | ||
{"value": 1.2} | ||
] | ||
} | ||
}, | ||
{ | ||
"value": 2, | ||
"subtree": { | ||
"meta": "child", | ||
"nodes": [ | ||
{"value": 2.1}, | ||
{"value": 2.2} | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "invalid tree", | ||
"data": { | ||
"meta": "root", | ||
"nodes": [ | ||
{ | ||
"value": 1, | ||
"subtree": { | ||
"meta": "child", | ||
"nodes": [ | ||
{"value": "string is invalid"}, | ||
{"value": 1.2} | ||
] | ||
} | ||
}, | ||
{ | ||
"value": 2, | ||
"subtree": { | ||
"meta": "child", | ||
"nodes": [ | ||
{"value": 2.1}, | ||
{"value": 2.2} | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"valid": false | ||
} | ||
] | ||
} | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see definitions used in this schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Relequestual
{"$ref": "node"}
points tohttp://localhost:1234/node
which is defined in#/definitions/node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How exactly does
{"$ref": "node"}
points tohttp://localhost:1234/node
? I don't follow.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base URI is
http://localhost:1234/tree
when you resolve relative urinode
it becomeshttp://localhost:1234/node
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's section 5.2 of RFC 3986