Skip to content

cannot find a file if $ref is a relative path #220

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
weerp opened this issue Apr 24, 2015 · 2 comments
Closed

cannot find a file if $ref is a relative path #220

weerp opened this issue Apr 24, 2015 · 2 comments

Comments

@weerp
Copy link

weerp commented Apr 24, 2015

The issue is the same as issue:
"Reference to local files (with relative/no path) doesn't work #98"

@Julian
Copy link
Member

Julian commented Apr 24, 2015

Hi!

Thanks for the report.

The issue you linked is a bit long, but did you consult the comments there?

It's true, $ref will not be able to find files if you put relative paths in it, because $ref is defined to take URLs, and you cannot put relative paths there unless you somehow define a base URL. You can do that via the id ref or by appropriately configuring your ref resolver.

Please take a look at that ticket and feel free to bring up any issues you have on the mailing list if you can't get it to work.

@Julian Julian closed this as completed Apr 24, 2015
@weerp
Copy link
Author

weerp commented Apr 27, 2015

Hello Julian,

The @sblask's solution is not common. It does not applicable for case of json schema files located in different folders with chain reference as bellow.
root_dir/dir_1/A.json
root_dir/dir_2/B.json
root_dir/dir_3/C.json

in A.json
{
....
{"$ref": "dir_2/B.json#/definitions/positiveInteger1"}
}
in B.json
{
....
{"$ref": "dir_3/C.json#/definitions/positiveInteger"}
}

Julian added a commit that referenced this issue May 4, 2018
ff448af Merge pull request #220 from pboettch/master
f8bee5b test false-exclusivity for max/min numbers

git-subtree-dir: json
git-subtree-split: ff448afa0a06c821c46a97e6d689974813c8f466
Julian added a commit that referenced this issue May 13, 2018
2ca50c0 The specs say T and Z is case insensitive for date-time.
43dad6a Port forward to draft 6 and 7.
498fd97 Tidy the descriptions a bit.
94ce498 Discard the changes that modify other tests.
afa2f40 Merge remote-tracking branch 'origin/pr/137'
ff448af Merge pull request #220 from pboettch/master
f8bee5b test false-exclusivity for max/min numbers
a72e5bf create seperate none-ascii pattern test case for additionalProperties false for draft 3 and 4
d3afa19 test updated with unicode pattern for additionalProperties in both draft

git-subtree-dir: json
git-subtree-split: 2ca50c0250b28499c9190cf10ce1d582dbee9ceb
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