Skip to content

Improve relativeBase #76

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
brettz9 opened this issue Feb 9, 2016 · 9 comments
Closed

Improve relativeBase #76

brettz9 opened this issue Feb 9, 2016 · 9 comments

Comments

@brettz9
Copy link
Contributor

brettz9 commented Feb 9, 2016

I would like relativeBase to potentially be a relative path itself (relative to window.location.href) and for it to be possible for this to differ from the base URL for the URL supplied to resolveRefsAt.

For example, if I have:

JsonRefs.resolveRefsAt('languages.json', {relativeBase: localesBase});

...I'd wish for localesBase to only apply to refs within languages.json, but not to the path of languages.json itself.

@whitlockjc
Copy link
Owner

I agree. I ran into this as well and I think the reason I didn't fix this before was tests depend on it, but I can fix this.

@brettz9
Copy link
Contributor Author

brettz9 commented Apr 10, 2016

Bump :)

@brettz9
Copy link
Contributor Author

brettz9 commented Oct 11, 2016

Hi @whitlockjc : Do you expect you will have any time to work on this?

@whitlockjc
Copy link
Owner

I'm working on it as we speak. :) Sorry for the delay, I don't work on Swagger tooling during my day job work anymore.

@whitlockjc
Copy link
Owner

The new resolver is deprecating options.relativeBase and instead using options.location (*At APIs will set options.location based on the path provided). The plan will be to then use another option for providing this option.

@whitlockjc
Copy link
Owner

This should had been fixed as a result of 0fc28fa and f69260d If not, please feel free to reopen.

@brettz9
Copy link
Contributor Author

brettz9 commented Apr 23, 2017

Thanks! Will be happy to take a look as I have a chance again...

@brettz9
Copy link
Contributor Author

brettz9 commented May 15, 2017

Does the change away from "relativeBase" mean that it will no longer work with relative paths? I was using it in this way before and it doesn't seem to work with a change as it says the file cannot be found (at a path not taking into account my "location")...

@whitlockjc
Copy link
Owner

options.relativeBase no longer is supported in general. options.location is used to represent the location of the document being processed (absolute or relative) and then all relative references are resolved relative to that document as expected.

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