OpenApi 与 apache camel-cxfrs 集成

问题描述 投票:0回答:1

我想基于我的 cxf 服务生成 openApi 文档。 我使用了以下资源: https://cxf.apache.org/docs/openapifeature.html 当我在不使用camel-cxfrs的情况下启动服务时 - 一切都按预期工作,生成 openapi.json 并且 swagger-ui 工作,但是当使用camel-cxfrs时 - apache Camel 拦截 openapi url 并尝试处理 我有以下蓝图:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
           xmlns:cxf="http://cxf.apache.org/blueprint/core"
           xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs"
           xmlns:camelcxf="http://camel.apache.org/schema/blueprint/cxf"
           xsi:schemaLocation="
             http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
             http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd
              http://cxf.apache.org/blueprint/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd
             ">
  <!-- JAXRS providers -->
  <bean id="jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider" />

  <!-- CXF OpenApiFeature -->
  <bean id="openApiFeature" class="org.apache.cxf.jaxrs.openapi.OpenApiFeature"/>

  <camelcxf:rsServer id="myRsServer" address="/service"
                     serviceClass="foo.MyService">
    <camelcxf:providers>
      <ref component-id="jsonProvider" />
    </camelcxf:providers>
    <camelcxf:features>
      <ref component-id="openApiFeature" />
    </camelcxf:features>
  </camelcxf:rsServer>


  <camelContext xmlns="http://camel.apache.org/schema/blueprint">

    <route>
      <from uri="cxfrs:bean:myRsServer"/>
      ....
    </route>

  </camelContext>
</blueprint>

使用的堆栈:

  • 卡拉夫4.2.4
  • 阿帕奇骆驼2.23.2
  • cxf 3.2.7
  • cxf-rs-description-openapi-v3(karaf 功能)
  • org.webjars/swagger-ui/3.23.8(捆绑包)

有没有办法在 apache Camel 中忽略某些 url(如相同的 cxf/service/openapi.json)?

apache-camel cxf openapi cxfrs camel-cxf
1个回答
0
投票

在camel和cxf的下一个版本中修复了https://issues.apache.org/jira/browse/CAMEL-12957

© www.soinside.com 2019 - 2024. All rights reserved.