Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

url parameter is ignored in Swagger 3.x it always defaults to the petstore #3045

Closed
talawahtech opened this issue May 6, 2017 · 6 comments
Closed

Comments

@talawahtech
Copy link

swagger-ui version: 3.0.9

I am trying to get swagger-ui to load my api definition file instead of the default petstore one, however modifying the url parameter for SwaggerUIBundle in the index.html file has no effect.

I was able to work around it by doing a find and replace for "https://petstore.swagger.io/v2/swagger.json" in swagger-ui-standalone-preset.js so my guess is that the presets are overriding the explicitly defined url param.

@JordanBelford
Copy link

@talawahtech

The example from 3.0.8 worked for me after I changed the url in index.html. Something must have broken 3.0.9 recently.

@zak905
Copy link

zak905 commented May 7, 2017

same issue here

@rstraszewski
Copy link

rstraszewski commented May 8, 2017

Same - after 3.0.9 update


Also wrong redirect_uri is send do identity server - "redirect_uri": "http://localhost:3200/oauth2-redirect.html" (some default value??), instead the one set in SwaggerUIBundle oauth2RedirectUrl property

@burnes
Copy link

burnes commented May 8, 2017

+1 Same here

@metroidprototype
Copy link

metroidprototype commented May 8, 2017

Can work around this for now by modifying the very end of swagger-ui-standalone-preset.js. Not 100% what other implications this might have, if any, but my v3.0.9 default url seems to be loading properly and the UI is functional.

Change:
e.exports='---\nurl: "http://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://online.swagger.io/validator"\noauth2RedirectUrl: "http://localhost:3200/oauth2-redirect.html"\n'

To:
e.exports=''

Will probably work for @rstraszewski 's oauth URL issue as well.

@webron
Copy link
Contributor

webron commented May 8, 2017

Yup, this is a bug, and indeed a big one. We have introduced in 3.0.9 a new mechanism to actually make configs more flexible, but... we ended up breaking the simple way of configuring it.

To get it working for now, check out the instructions at https://github.com/swagger-api/swagger-ui#configs-plugin. What's broken is that the constructor config should take over the pre-compiled configs, otherwise...

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

8 participants