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

Request url - server variables not parsed properly #926

Closed
magicware opened this issue May 27, 2019 · 5 comments
Closed

Request url - server variables not parsed properly #926

magicware opened this issue May 27, 2019 · 5 comments

Comments

@magicware
Copy link

magicware commented May 27, 2019

ReDoc Version: "2.0.0-rc.8-1"

First case:
image
image

Second case:
image
image

Third case:
image
image

Live links:
ReDoc:
https://magicware.github.io/api/#tag/Business-case/paths/~1reservations~1businessCases/get
Swagger:
https://magicware.github.io/api/swagger-ui#/Business%20case/get_reservations_businessCases
Definition:
https://magicware.github.io/api/swagger.yml

I don't actually know, if my definition is wrong or any special characters are not allowed as servers definition variables. But swagger seems working fine. The thing is, I need in the url some special characters for user, so he sees it as a placeholder for the value further in the documentation. The api can be in various environments based on every request. But the special characters are translated as proper url, which may be good, but does not fit for us. What is the recommended approach?
Can you help me?
Thanks in advance.

@unional
Copy link

unional commented Aug 15, 2019

I have the same issue:

image

@ivankravets
Copy link

Related tiangolo/fastapi#594

@HacKanCuBa
Copy link

When servers is not specified in the openapi definition, this lib uses the current URL and prepends it to the paths definition. This leads to issues when the documentation view is prefixed along with the api routes.
SwaggerUI does not seem to have this issue.

image

Without servers definition:

image

With servers definition:

image

@TheM1984
Copy link

TheM1984 commented Jun 2, 2020

For anybody that searches and finds this "old" issue.

Please look at the following ReDoc option:
expandDefaultServerVariables

With the redoc-cli enable this via --options.expandDefaultServerVariables

@RomanHotsiy
Copy link
Member

Fixed server variables with hyphens and dots. Other use cases reported work fine now. The 3rd case was a valid behavior.

The reasoning behind expandDefaultServerVariables here: #1012 (comment)

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

5 participants