How to integrate swagger-ui in my application

前端 未结 5 1899
盖世英雄少女心
盖世英雄少女心 2021-01-04 08:06

I am trying to integrate swagger with camel project

following this example https://github.com/smparekh/camel-example-servlet-rest-tomcat

How do i access swa

5条回答
  •  执笔经年
    2021-01-04 08:27

    You must copy the contents of the dist folder of swagger-ui into your project's webapp folder.

    In index.html,

      window.swaggerUi = new SwaggerUi({
      url: "http://petstore.swagger.wordnik.com/api/api-docs",
      dom_id: "swagger-ui-container",
    

    you must replace url with this

     http://localhost:8080/camel-example-servlet-rest-tomcat/api-docs
    

    For details, Follow this link to integrate swagger-ui.

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

提交回复
热议问题