Search code examples
spring-mvcswagger-uiswagger-2.0

how to find the swagger path


I have the following swagger config. now what would be my swagger path to open the swagger-ui in browser.

            .select()
            .apis(RequestHandlerSelectors.any())
            .paths(PathSelectors.regex(".*/v2/accounts/.*"))
            .build()
            .securitySchemes(Collections.singletonList(apiKey()))
            .securityContexts(Collections.singletonList(securityContext()));

Solution

  • You can use below approach:

    1. install globally on node package http-server using command - npm install -g http-server
    2. Run http-server --cors after changing directories to where your.json is located
    3. Open swagger ui (i.e. dist/index.html)
    4. Put http://localhost:8080/your.json in input field and click "Explore"