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
swagger-ui 'try it' generating curl urls with http scheme even though swagger.json only has https scheme #3166
Comments
I'm not able to reproduce this in the latest version, though I do see it on Petstore. I'll circle back on this on Monday to confirm a fix, once we've redeployed Petstore... probably was some dependency weirdness. |
I tried this again with petstore.swagger.io and the issue still appears to be there. |
Confirmed. @shockey - the issue is there. |
Hi, Regards, |
I'm working on it now, @santoshghalsasi. It'd be helpful if you could share a spec that causes the problem, and shared how you use Swagger-UI (via swagger.io, via static files, or via npm). Thanks! |
Hi @shockey, We are using static files(I guess that is what you mean when we copy the swagger UI files and use it somewhere else) and using below spec to test it(have removed some part due to confidentiality) - {
} Please let me know if you need any more info. Regards, |
Hi @shockey, Many Thanks, |
Hey folks, No promises on a timeline, but I'm working on this today. I think I've gotten to the bottom of it. I'm only able to reproduce this by loading a spec with the text input in the Explore bar. Loading the spec via config should let you work around this problem. @santoshghalsasi and @pjfanning: are you loading your specs by pasting the URL into the Explore bar? If so, can you try loading your spec by adding |
@shockey In a quick test with http://petstore.swagger.io, I seem to see the behaviour that you describe. My swagger json only has HTTPS scheme (but the swagger.json itself is fetched from a HTTP endpoint). |
Great, you should be able to lean on that as a workaround while we get this patched. It looks like Swagger-UI is passing a bad value for the scheme dropdown once a second spec is loaded into the UI - it incorrectly hangs onto the value from the first spec. We give the scheme dropdown priority when we decide what scheme to use for a Try-It-Out request, so that bad value overrides all other indicators ( |
This should be fixed in Please note that the changes won't be live on Petstore or in the distributed packages until we do our next release, which will be next week. If you need this fix ASAP, you can clone the repository and build the project for your own use. Thanks for the help with identifying this, @pjfanning and @santoshghalsasi! |
Hi @shockey, Regards, |
@santoshghalsasi No worries. Here's an overview: You'll need
Unless you run into some errors, you should end up with some fresh files in the This is a pretty standard setup for a JavaScript project, so you shouldn't have much trouble Googling your way through it. Feel free to open a ticket if you're having a problem running the build. Thanks again! |
@shockey - Thank you for the direction. I could get it imported and make it work. I can now see that the URL is being constructed with 'https'. Thanks, |
Hi @shockey - I am seeing a special character 'A' embedded at the end of each parameter name in the UI like below for my specs - It was not there previously. Can you please let me know the possible reason behind this? Thanks, |
@santoshghalsasi, I opened the spec that you provided and I'm not seeing that happen: If this is happening consistently, please consider opening a new Github issue that better describes how to reproduce the problem. Screenshots would be helpful as well. |
@shockey, We had done some changes in the index.html file in order to make it work properly on the sharepoint and pick and load the specs dynamically. I added the encoding configuration(given below) in that file and it seems to have resolved the problem. I will let this tested by my team and will get back to you in case we need any more info. I hope addition of this encoding configuration is fine -
Thanks, |
Found with current http://petstore.swagger.io/ UI (doesn't display a software version number).
The text was updated successfully, but these errors were encountered: