[
https://issues.apache.org/jira/browse/CAMEL-12943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16692859#comment-16692859
]
ASF GitHub Bot commented on CAMEL-12943:
----------------------------------------
tdiesler commented on issue #2623: CAMEL-12943: Rest DSL generates invalid
swagger operation Id
URL: https://github.com/apache/camel/pull/2623#issuecomment-440189881
This patch seems to fix the contentID issue, but is still not working for
nested context paths
```
09:28:45,428 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2)
MSC000001: Failed to start service
jboss.deployment.unit."UndertowSecureRestDslSpringIntegrationTest3.war".CamelContextActivationService."UndertowSecureRestDslSpringIntegrationTest3.war":
org.jboss.msc.service.StartException in service
jboss.deployment.unit."UndertowSecureRestDslSpringIntegrationTest3.war".CamelContextActivationService."UndertowSecureRestDslSpringIntegrationTest3.war":
Cannot create camel context: UndertowSecureRestDslSpringIntegrationTest3.war
at
org.wildfly.extension.camel.service.CamelContextActivationService.start(CamelContextActivationService.java:71)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
at
org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
at
org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at
org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.msc.service.StartException in anonymous service: Cannot
start camel context: secure-rest-context2
at
org.wildfly.extension.camel.service.CamelContextActivationService.start(CamelContextActivationService.java:67)
... 8 more
Caused by: org.apache.camel.RuntimeCamelException:
java.lang.IllegalStateException: Cannot add io.undertow.server.HttpHandler for
path /test defined in
deployment.UndertowSecureRestDslSpringIntegrationTest3.war because that path is
already served by deployment.UndertowSecureRestDslSpringIntegrationTest1.war
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1826)
at
org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:136)
at
org.wildfly.extension.camel.service.CamelContextActivationService$1.run(CamelContextActivationService.java:63)
at
org.wildfly.extension.camel.proxy.ProxyUtils$1.invoke(ProxyUtils.java:51)
at com.sun.proxy.$Proxy88.run(Unknown Source)
at
org.wildfly.extension.camel.proxy.ProxyUtils.invokeProxied(ProxyUtils.java:55)
at
org.wildfly.extension.camel.service.CamelContextActivationService.start(CamelContextActivationService.java:60)
... 8 more
Caused by: java.lang.IllegalStateException: Cannot add
io.undertow.server.HttpHandler for path /test defined in
deployment.UndertowSecureRestDslSpringIntegrationTest3.war because that path is
already served by deployment.UndertowSecureRestDslSpringIntegrationTest1.war
at
org.wildfly.extension.camel.undertow.CamelUndertowHostService$WildFlyUndertowHost.validateEndpointContextPath(CamelUndertowHostService.java:211)
at
org.wildfly.extension.camel.undertow.CamelUndertowHostService$WildFlyUndertowHost.validateEndpointURI(CamelUndertowHostService.java:170)
at
org.apache.camel.component.undertow.UndertowComponent.registerEndpoint(UndertowComponent.java:336)
at
org.apache.camel.component.undertow.UndertowConsumer.doStart(UndertowConsumer.java:77)
at
org.wildfly.extension.camel.undertow.WildFlyUndertowComponent$WildFlyUndertowUndertowConsumer.doStart(WildFlyUndertowComponent.java:86)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
at
org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:3709)
at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:4027)
at
org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:3962)
at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3882)
at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3646)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3489)
at
org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3248)
at
org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3244)
at
org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3267)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3244)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3160)
at
org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:133)
... 13 more
```
You can reproduce this with branch
https://github.com/wildfly-extras/wildfly-camel/tree/camel-2.23.x
```
mvn clean install -Dts.all -DskipTests
mvn install -Dts.all -pl itests/standalone/basic
-Dtest=UndertowSecureRestDslSpringIntegrationTest
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Rest DSL generates invalid swagger operation Id
> -----------------------------------------------
>
> Key: CAMEL-12943
> URL: https://issues.apache.org/jira/browse/CAMEL-12943
> Project: Camel
> Issue Type: Bug
> Components: camel-swagger
> Reporter: Thomas Diesler
> Assignee: Dmitry Volodin
> Priority: Major
> Fix For: 2.23.0
>
>
> With this code
>
> {code:java}
> rest("/customers").description("Customers REST service")
> .get("/\{id}")
> .bindingMode(RestBindingMode.auto)
> .id("getCustomerById")
> .description("Retrieves a customer for the specified id")
> .outType(Customer.class)
> .route()
> .process(exchange -> {
> Customer customer = new Customer();
> customer.setId(exchange.getIn().getHeader("id",
> Integer.class));
> customer.setFirstName("Kermit");
> customer.setLastName("The Frog");
> exchange.getOut().setBody(customer);
> })
> .endRest();
> {code}
>
> we see a swagger definition generated like this
>
> {code:java}
> "paths" : {
> "/customers/\{id}" : {
> "get" : {
> "tags" : [ "customers" ],
> "summary" : "Retrieves a customer for the specified id",
> "operationId" : "route2",
> "parameters" : [ {
> "name" : "id",
> "in" : "path",
> "required" : true,
> "type" : "string"
> } ],
> "responses" : {
> "200" : {
> "description" : "Output type",
> "schema" : {
> "$ref" : "#/definitions/Customer",
> "originalRef" : "Customer"
> },
> "responseSchema" : {
> "$ref" : "#/definitions/Customer",
> "originalRef" : "Customer"
> }
> }
> }
> }
> }
> },
> {code}
>
> The operationId seems to be incorrect.
>
> In our testsuite, which checks the latest Camel HEAD every Monday, we see ...
>
> {code:java}
> Caused by: java.lang.IllegalArgumentException: The specified operation with
> ID: `getCustomerById` cannot be found in the Swagger specification loaded
> from `http://localhost:8080/api/swagger`. Operations defined in the
> specification are: route2
> at
> org.apache.camel.component.rest.swagger.RestSwaggerEndpoint.createProducer(RestSwaggerEndpoint.java:198)
> at
> org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:573)
> ... 190 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)