Redoc: Request url - server variables not parsed properly

Created on 27 May 2019  路  5Comments  路  Source: Redocly/redoc

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.

Most helpful comment

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

All 5 comments

I have the same issue:

image

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

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

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: https://github.com/Redocly/redoc/issues/1012#issuecomment-520979138

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bmarwell picture bmarwell  路  3Comments

gauravmokhasi picture gauravmokhasi  路  4Comments

RamakrishnaChilaka picture RamakrishnaChilaka  路  3Comments

typekpb picture typekpb  路  4Comments

yuji38kwmt picture yuji38kwmt  路  3Comments