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

The query string 'url' and 'filter' are invalid #7983

Open
Maxwell1987 opened this issue Apr 17, 2022 · 3 comments
Open

The query string 'url' and 'filter' are invalid #7983

Maxwell1987 opened this issue Apr 17, 2022 · 3 comments

Comments

@Maxwell1987
Copy link

when I use docker.io/swaggerapi/swagger-ui:v4.1.2, I can use http://domain?url=xxx.yaml&filter=true to directly access xxx.yaml when opening the page, and display the filter.

from docker.io/swaggerapi/swagger-ui:v4.1.3 to docker.io/swaggerapi/swagger-ui:v4.10.3, the query string 'url' and 'filter' are invalid.

  • OS: macOS
  • Browser: firefox
  • Version: 99.0.1
  • Method of installation: docker
  • Swagger-UI version: 4.1.3 to 4.10.3
  • Swagger/OpenAPI version: OpenAPI 3.0

?yourQueryStringConfig

?url=path_to_yaml_url&filter=true
@sam-ludlow
Copy link

I've seen this.

Just static serve the "dist" folder from release / asset / sourcecode.zip

Pass ?url=mySwagger.yaml

Last version that works is swagger-ui-4.1.2

@Gama11
Copy link

Gama11 commented Apr 26, 2022

I've also run into this, although I just discovered that this was apparently an intentional change:

https://github.com/swagger-api/swagger-ui/releases/tag/v4.1.3

Bug Fixes

security: disable reading config params from URL search params (#7697) (01a3e55), closes #4872, security advisory GHSA-qrmm-w75w-3wpx

Note: to re-enable the functionality of reading config params from URL, set new queryConfigEnabled core parameter to true. More info in documentation.

What's awkward about this is that urls.primaryName is still automatically added when selecting a definition from the dropdown, it just doesn't do anything. Also a bit strange that such a breaking change was made in a patch release.

@Maxwell1987
Copy link
Author

So that's the reason. I didn't expect to have this change in a patch release, nor did I think to check the documentation

For security reasons, it is actually possible to add a uri parameter, which would be convenient for scenarios like mine where documents are stored centrally. In fact, I would prefer uri to url.

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

3 participants