-
Notifications
You must be signed in to change notification settings - Fork 20
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
Can't use relative URL to spec.yaml file #12
Comments
@sn4kebite sorry for the late reply, I've been busy lately. :( I'm not quite sure I understand your use case correctly. Could you please elaborate? For what purpose exactly you want to use relative HTTP URL? I mean, if you specify a path on filesystem, the spec would be copied to output directory and relative URL would be used automatically. |
Alternatively, in some cases (when only domain is changed), you may use something like: 'spec': 'http:///api/rest/spec.yaml', which will try to download the spec from Please respond whether it worked for you or not. |
I am building a docker image containing both API and documentation. The spec.yaml file is not available when the documentation is being built, as it is generated by the API on demand. From what I understand this is when you want to use an HTTP URL to the spec, however I don't know the URL in advance. The spec can however be found relative to the docs, so using a relative URL in this case solves this problem. Using the HTTP URL without hostname is a neat trick (I didn't know you could do that), but I'm concerned how well supported it is (no results on google that I could find), and it only works with either http or https. |
Well, honestly, I don't know; this is behaviour I observe in Python when you do
A doubt Redoc.js support any other protocol except for HTTP(s). It's a limitation of JS machines in browsers. Still I do understand your use case now. I'm thinking about fallbacking to HTTP relative URI if the corresponding file wasn't found. I.e.
|
I'm trying to use a relative URL to the spec.yaml file, which fails because it's interpreted as a file path:
I need to use a relative path because the generated docs will be deployed on multiple hosts, and I don't want to bind the spec to a specific host. As a workaround I'm using the full URL in the config, then edit the generated html file manually before deployment.
The text was updated successfully, but these errors were encountered: