Java 带有ApacheCamel3(servlet)和#x2B的招摇过市UI;弹簧靴2

Java 带有ApacheCamel3(servlet)和#x2B的招摇过市UI;弹簧靴2,java,spring-boot,apache-camel,swagger,swagger-ui,Java,Spring Boot,Apache Camel,Swagger,Swagger Ui,骆驼+弹簧靴+招摇过市的新手。 使用Camel 3.8.0和SpringBoot 2.4.2创建了一些restapi(在SpringBoot的默认TomCat上使用Camel的Servlet) 下面是pom.xml <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId>

骆驼+弹簧靴+招摇过市的新手。 使用Camel 3.8.0和SpringBoot 2.4.2创建了一些restapi(在SpringBoot的默认TomCat上使用Camel的Servlet)

下面是pom.xml

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.4.2</version>
    <relativePath/>
</parent>

<groupId>com.crsardar.java.apache.camel</groupId>
<artifactId>hands-on-camel-springboot</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>

    <camelVersion>3.8.0</camelVersion>
</properties>

<dependencies>
    <!-- SpringBoot -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <!-- Camel -->
    <dependency>
        <groupId>org.apache.camel.springboot</groupId>
        <artifactId>camel-spring-boot-bom</artifactId>
        <version>${camelVersion}</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-jackson</artifactId>
        <version>${camelVersion}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-servlet-starter</artifactId>
        <version>${camelVersion}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel.springboot</groupId>
        <artifactId>camel-spring-boot-starter</artifactId>
        <version>${camelVersion}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel.springboot</groupId>
        <artifactId>camel-rest-swagger-starter</artifactId>
        <version>${camelVersion}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-swagger-java</artifactId>
        <version>${camelVersion}</version>
        <exclusions>
            <exclusion>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>*</artifactId>
            </exclusion>
        </exclusions>
    </dependency>


    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>swagger-ui</artifactId>
        <version>2.2.10</version>
    </dependency>
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>webjars-locator</artifactId>
        <version>0.40</version>
    </dependency>


    <!-- Others -->
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.18</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>
我正试图记录它,并提供一个选项来测试它使用招摇过市的用户界面

如果我运行应用程序并点击
http://127.0.0.1:8080/api-文档
我正在获取斯威格的API文档

但是,我无法使用Swagger UI进行尝试,如何使Swagger UI在其上工作?

我不知道-这个应用程序是否使用了Swagger UI?如果工作正常,Swagger UI的URL是什么


完整的代码在这里

在互联网上搜索了很多,但可以找到关于“带驼峰3(servlet)+SpringBoot 2的招摇过市UI”组合的很多信息,所有这些都是使用旧版本驼峰和SpringBoot的工作示例
package com.crsardar.java.apache.camel;

import com.crsardar.java.dao.Order;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.model.rest.RestBindingMode;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;

@Component
public class CamelController extends RouteBuilder {

    @Override
    public void configure() throws Exception {

        restConfiguration()
                .component("servlet")
                .port(8080)
                .host("127.0.0.1")
                .apiContextPath("api-docs")
                .apiContextIdPattern("#name#")
                .apiProperty("api.title", "Test REST API")
                .apiProperty("api.version", "v1")
                .apiProperty("cors", "true")
                .bindingMode(RestBindingMode.json);

        rest().post("/order")
                .produces(MediaType.APPLICATION_JSON_VALUE)
                .type(Order.class)
                .outType(Order.class)
                .to("bean:orderService?method=addOrder(${body})");

        rest().get("/order")
                .produces(MediaType.APPLICATION_JSON_VALUE)
                .to("bean:orderService?method=getOrders()");

    }
}