-
Notifications
You must be signed in to change notification settings - Fork 33
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
Support openAPI relative path #24
Comments
In theory, open api 3 and 2 can be supported, and relative paths are also supported (depending on your own deployment location). However, I will give a definitive answer after testing later. |
Compatible with
Relative paths are supported, but it looks like you need to deal with basePath in openApi (this part may not be what redoc-try should do swagger-api/swagger-ui#5981) |
Thanks for checking!
It works as parameter appended to the url. The above does not work. I am not super familiar with js. |
@sbilello I created a project using your code above, please try if it helps. 👉 https://stackblitz.com/edit/redoc-try-issues-24?file=index.html |
I see you are running a node.js server.
Which is the cli instruction?
I was just performing open index.html
from the terminal.
Thanks 🙏
…On Tue, Nov 22, 2022, 6:15 PM xw ***@***.***> wrote:
@sbilello <https://github.com/sbilello> I created a project using your
code above, please try if it helps.
[image: image]
<https://user-images.githubusercontent.com/28223260/203457213-3f21835d-9ec8-468f-8d9a-93c41e1e7997.png>
https://stackblitz.com/edit/redoc-try-issues-24?file=index.html
—
Reply to this email directly, view it on GitHub
<#24 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN3GUHTSEGKWURBU5RIUETWJV43LANCNFSM6AAAAAASHGW3ZY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
It uses http-server instead of opening files directly via open. When opening a file through the open command, the file:// protocol is used, which does not allow ajax to read the file. So it is recommended to use the http:// method. |
Thank you for your response!
…On Tue, Nov 22, 2022, 6:55 PM xw ***@***.***> wrote:
It uses http-server <https://www.npmjs.com/package/http-server> instead
of opening files directly via open.
When opening a file through the open command, the file:// protocol is
used, which does not allow ajax to read the file. So it is recommended to
use the http:// method.
see:
https://stackoverflow.com/questions/39007243/cannot-open-local-file-chrome-not-allowed-to-load-local-resource
—
Reply to this email directly, view it on GitHub
<#24 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN3GUBPOEBCOFMGAVAW4XDWJWBTVANCNFSM6AAAAAASHGW3ZY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Maybe it works out of the box for simple http protocol on linux/mac # python<=2.3
python -c "import SimpleHTTPServer as s; s.test();" 8000
# python>=2.4
python -m SimpleHTTPServer 8000
# python 3.x
python -m http.server 8000 |
Last question:
Is there a way to remove the url parameter openApi:.... override?
Thanks
…On Tue, Nov 22, 2022, 6:59 PM xw ***@***.***> wrote:
Maybe it works out of the box for simple http protocol on linux/mac
# python<=2.3
python -c "import SimpleHTTPServer as s; s.test();" 8000# python>=2.4
python -m SimpleHTTPServer 8000# python 3.x
python -m http.server 8000
—
Reply to this email directly, view it on GitHub
<#24 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN3GUDBH65U7VTAINO5ORLWJWCAPANCNFSM6AAAAAASHGW3ZY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
https://wll8.github.io/redoc-try/index.html?openApi=./test/openapi.3.yaml The parameters on the url are just for me to switch the demo parameters, in fact, you don't need it, there is no problem of overwriting. It is recommended to refer to the code in this place: https://stackblitz.com/edit/redoc-try-issues-24?file=index.html |
Hello!
Thanks for creating this project!
I was curious if we are able to extend the
openApi
param to support a relative file system url and not only a url.Example:
Does this tool supports both
openAPI 3
andswagger 2.0
json specifications?The text was updated successfully, but these errors were encountered: