Skip to content
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

Allow in-schema references ? #274

Open
JulienPalard opened this issue Feb 12, 2016 · 5 comments
Open

Allow in-schema references ? #274

JulienPalard opened this issue Feb 12, 2016 · 5 comments

Comments

@JulienPalard
Copy link

Context: I'm using https://github.com/Julian/jsonschema to validate my API, and I'm trying to generate doc using prmd.

In jsonschema I have hard times to use absolute imports, so I'm using relative imports like just {"$ref": "user.json"} and it works like a charm, it's simple, short to type, nice.

But it looks like in prmd I have use full paths like {"$ref": "/schemata/user.json#/definitions/login"} which is a bit verbose. I understand you don't want to mess with relative imports like {"$ref": "user.json#/definitions/login"} or like {"$ref": "../user.json#/definitions/login"} but why not just allowing {"$ref": "#/definitions/login"} ? Seems a legitimate syntax, simple and readable, and not ambiguous.

@geemus
Copy link
Member

geemus commented Feb 23, 2016

@JulienPalard I think it is probably just coincidental that it is this way, based on how we have load paths and stuff, but I'm not certain. I'd certainly be up for revisiting if you wanted to experiment with the code and see if you could get that working. Thanks!

@JulienPalard
Copy link
Author

Argh, sry, I won't be able to "experiment with the code", I don't want to learn perl today, sry for that :-( (I try to learn a language a year, but didn't learnt perl yet :-P nothing religious here). If someone read this issue, you can try it, but don't wait for me to do it :-P

@geemus
Copy link
Member

geemus commented Feb 29, 2016

@JulienPalard fair enough (though it should be Ruby instead of perl).

@JulienPalard
Copy link
Author

@geemus (Please excuse this probably inexcusable confusion þ)

@geemus
Copy link
Member

geemus commented Mar 1, 2016

No worries!

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