mshauneu / chrome-swagger-ui

Chrome Extension for Swagger UI
17 stars 7 forks source link

Http/Https curl calls problem, swagger UI does not use default swagger doc protocol after update #10

Closed emreerguden closed 7 years ago

emreerguden commented 7 years ago

Hello,

Thanks for great extension. There is a problem after last update. We use both http and https schemas in our swagger doc. When both of them exists, swagger UI chooses the https one by default.

Swagger UI original code has also bug fix for this issue. The previous and default behaviour is, protocol is defined by the swagger doc url protocol.

if http://.... /swagger.json then curl calls are http, if http://... /swagger.json then curls calls are https.

You can check by the latest version of Swagger UI release

https://github.com/swagger-api/swagger-ui/releases

They fixed it in 5 or before.. Thanks

@emreerguden it is not about your extension, it is about swagger-js. So i manually fixed the problem in swagger-js and load it in dev mode thanks.

emreerguden commented 7 years ago

i have sent pull request for this bug to swagger-js,

https://github.com/swagger-api/swagger-js/pull/913

mshauneu commented 7 years ago

Thanks a lot.

emreerguden commented 7 years ago

Would you consider to get the fix and make another release before swagger-ui release a new version? Or will you wait for the swagger released to be fixed?

emreerguden commented 7 years ago

Hi, They have merged the fix in their code https://github.com/swagger-api/swagger-js/pull/913 and rebuilt the swager ui. You can check in the client.js the code below.

} else if (typeof window !== 'undefined' && window.location.protocol.startsWith('chrome-extension')) { // if it is chrome swagger ui extension scheme then let swagger doc url scheme decide the protocol this.scheme = location.scheme;

If you could only get the latest master swager-ui everything will be fine for this issue and the related issue

https://github.com/mshauneu/chrome-swagger-ui/issues/9

Thanks

Fixed Version is 2.2.8

mshauneu commented 7 years ago

Just published updated version (0.7)

emreerguden commented 7 years ago

Issue seems to be solved with 0.0.7 version, thanks

mshauneu commented 7 years ago

thank @emreerguden for helping