swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.66k stars 8.97k forks source link

Session timeout support in Swagger UI #4534

Closed riti-suk closed 6 years ago

riti-suk commented 6 years ago

Hi,

Do you provide session timeout support in Swagger UI 2.4 version?

Scenario is: For get API, response code is coming as success instead of session timeout in case login session is timed out.

shockey commented 6 years ago

Hi @riti-suk, session timeout is something you'd implement in your API. Swagger-UI will handle/display many of the common indicators of an expired session (HTTP 401, 301 redirect, etc) if you write it into your Swagger document.

PS: Swagger-UI 2.x is unmaintained and unsupported as of March 2017 - please use the new version!

riti-suk commented 6 years ago

Hi @shockey has version 3.x has been released for java platform as we can't find the version 3.x on maven central repository, are they still unreleased?

We're using the following dependencies right now:

        <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>2.2.2</version>
    </dependency>
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>2.4.0</version>
    </dependency>

Please advice the best way to go. Thanks.

shockey commented 6 years ago

@riti-suk, that's Springfox, not Swagger-UI 😄 you should inquire in the Springfox repository: https://github.com/springfox/springfox/issues

riti-suk commented 6 years ago

@shockey, i would like to change from io.springfox to webjars, can you share changes required if you are aware of. It would be of great help. Thanks in advance

shockey commented 6 years ago

I personally have no idea how to use a webjar, perhaps @heldersepu can advise 😄

heldersepu commented 6 years ago

Ohh Yes! WebJars... Ain't no thing but a chicken wing!

I got a few of those for Christmas last year: image

riti-suk commented 6 years ago

@heldersepu can u help me in this. I am using io.springfox for swagger ui in java but want to move to org.webjars. So what steps should i follow?

heldersepu commented 6 years ago

@riti-suk Sorry I have no experience with springfox or webjars...

I thought that my very nonsensical comment made that point for me

maheshm2195 commented 6 years ago

@shockey @heldersepu Can anyone of you suggest any way we can upgrade to latest Swagger UI from the springfox dependencies. Springfox dependencies have 2.8.0 as the latest version which are all buggy in one way or other for example zip responses can't be downloaded (gets corrupted). Thanks.

heldersepu commented 6 years ago

@maheshm2195 think outside springfox...

any way we can upgrade to latest Swagger UI

I do not know enough about springfox but all you need is you "swagger.json" from it, that looks like: http://swagger-net-test.azurewebsites.net/swagger/docs/V1 once you have that, you can go to any Swagger UI an use the url param: http://petstore.swagger.io/?url=http://swagger-net-test.azurewebsites.net/swagger/docs/V1

You can host the js & html independent from your springfox.

shockey commented 6 years ago

@riti-suk I don't have any experience with webjars (or Java, for that matter) - we don't maintain those, it appears that they automatically mirror npm modules (for JavaScript).

I've pinged a few more folks, maybe I can track down someone that can help here 😄

shockey commented 6 years ago

Closing due to inactivity.

This is simply to keep our issue tracker clean - feel free to comment if there are any further thoughts or concerns, and we'll be happy to reopen this issue.

lock[bot] commented 5 years ago

Locking due to inactivity. This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content. If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report. Thanks!