swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

relative paths and https support

Open GitDsFn opened this issue 12 years ago • 5 comments

Hi team wordnik,

When i try to work with relative paths and https protocol the generated json files will not be loaded from swagger-ui. The json files will be loaded under the http protocol, but my application needs the https protocol. To fix this problem temporarily I use the "useJQuery : true" parameter in the SwaggerUi object. So requesting jsons with https is working correctly. I think it would be possible that there is a bug in shred.bundle.js and the https protocol should be set correctly even if I work with relative paths for my swagger url.

Cheers

GitDsFn avatar Aug 14 '14 12:08 GitDsFn

@GitDsFn Thanks for your comment. I'm still having the same issue. Could you tell me how exactly you got it working?

Cheers

simondelorean avatar Aug 15 '14 22:08 simondelorean

@simonbogarde I only set "useJQuery" parameter to true and integrated the jquery javascript to field and it worked for me. Here's a excerpt from my swaggerUi index.html.

$(function() {
    window.swaggerUi = new SwaggerUi({
        url : "service.json",
        dom_id : "swagger-ui-container",
        useJQuery : true,
        supportedSubmitMethods : [ 'get', 'post', 'put', 'delete' ],
                    ...
    });
    window.swaggerUi.load();
});

Best regards

GitDsFn avatar Aug 18 '14 06:08 GitDsFn

hello @GitDsFn thank you so much for posting this! I was wondering how you integrated the jquery javascript to field as you described above? I've put "useJQuery : true" in my html but I need to connect that to the backend javascript somehow

mkrouwer avatar Oct 01 '14 17:10 mkrouwer

I believe this is fixed but will confirm and close out afterwards.

fehguy avatar Jan 28 '15 21:01 fehguy

confirmed fixed.

fehguy avatar Jan 30 '15 08:01 fehguy