Java 如何使用Spring Boot在Swagger for Apache Camel中添加安全定义?

Java 如何使用Spring Boot在Swagger for Apache Camel中添加安全定义?,java,spring-boot,apache-camel,swagger,authorization,Java,Spring Boot,Apache Camel,Swagger,Authorization,我正在这样做,但它不起作用 restConfiguration().component("servlet") .enableCORS(true) .bindingMode(RestBindingMode.json) .skipBindingOnErrorCode(false) .clientRequestValidation(true) .dataFormatProperty("prettyPrint", "

我正在这样做,但它不起作用

restConfiguration().component("servlet")
    .enableCORS(true)
    .bindingMode(RestBindingMode.json)
    .skipBindingOnErrorCode(false)
    .clientRequestValidation(true)
    .dataFormatProperty("prettyPrint", "true")
    .apiContextPath("/swagger")
    .apiProperty("api.title", "STP API")
    .apiProperty("api.version", "1.2.3");

rest("/stp")
    .securityDefinitions()
    .oauth2("swagger-ui").authorizationUrl("http://localhost:8030/webjars/swagger-ui/index.html?url=/camel/swagger&validatorUrl=").end()
    .end()
.post("/result")
    .security("swagger-ui", "write:swagger,read:swagger")
    .description("Stp status data")
    .produces(Constants.APPLICATION_JSON)
    .consumes(Constants.APPLICATION_JSON)
    .type(SQSStpStatusDto.class)
    .to(DirectRoutes.DIRECT_STP_RESULT_ROUTE)