2016-06-30 84 views
0

是否可以在駱駝春季應用程序中配置swagger。我曾嘗試在駱駝藍圖xml和其工作,但無法與駱駝春應用程序集成swagger集成。駱駝上下文中的swagger配置xml文件

下面的配置加入藍圖XML文件中的駱駝Spring上下文xml文件做相同的配置

<service interface="javax.servlet.http.HttpServlet"> 
     <service-properties> 
      <entry key="alias" value="/api-docs/*" /> 
      <entry key="init-prefix" value="init." /> 
      <entry key="init.base.path" value="//0.0.0.0:8080/rest" /> 
      <entry key="init.api.path" value="//0.0.0.0:8181/api-docs" /> 
      <entry key="init.api.title" value="Camel Rest Example API" /> 
      <entry key="init.api.version" value="1.2" /> 
      <entry key="init.api.description" value="Camel Rest Example with Swagger that provides an User REST service" /> 
     </service-properties> 
     <bean class="org.apache.camel.component.swagger.DefaultCamelSwaggerServlet" /> 
    </service> 

能否請你幫忙。 Thans提前。

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://camel.apache.org/schema/cxf" 
    xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:mongo="http://www.springframework.org/schema/data/mongo" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:util="http://www.springframework.org/schema/util" xmlns:camel="http://camel.apache.org/schema/spring" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd 
     http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd 
     http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.5.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd 
     http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd 
     http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd  
     http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> 

<required code> 
</beans> 

回答