You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/04/28 12:41:25 UTC

[GitHub] [camel-quarkus] jamesnetherton opened a new issue #2527: Unable to generate REST API documentation when lightweight mode is enabled

jamesnetherton opened a new issue #2527:
URL: https://github.com/apache/camel-quarkus/issues/2527


   https://github.com/apache/camel-quarkus/issues/2063 enables 'lightweight' mode in the `camel-quarkus-rest` integration test.
   
   I made some mods to test generating API docs with OpenAPI. E.g like:
   
   ```java
   @Override
   public void configure() {
       restConfiguration().apiContextPath("/docs");
   
       rest()
               .get("/rest/get")
               .description("The rest GET method")
               .route()
               .setBody(constant("GET: /rest/get"))
               .endRest()
   
               .post("/rest/post")
               .description("The rest POST method")
               .consumes("text/plain").produces("text/plain")
               .route()
               .setBody(constant("POST: /rest/post"))
               .endRest();
   }
   ```
   
   Invoking the ` /docs` endpoint results in:
   
   ```
   2021-04-28 13:21:59,787 WARN  [org.apa.cam.ope.RestOpenApiProcessor] (vert.x-worker-thread-0) Error rendering OpenApi API due null: java.lang.NullPointerException
   	at org.apache.camel.quarkus.core.FastCamelContext.getRestDefinitions(FastCamelContext.java:757)
   	at org.apache.camel.openapi.DefaultRestDefinitionsResolver.getRestDefinitions(DefaultRestDefinitionsResolver.java:36)
   	at org.apache.camel.openapi.RestOpenApiSupport.getRestDefinitions(RestOpenApiSupport.java:361)
   	at org.apache.camel.openapi.RestOpenApiSupport.renderResourceListing(RestOpenApiSupport.java:399)
   	at org.apache.camel.openapi.RestOpenApiProcessor.process(RestOpenApiProcessor.java:122)
   	at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
   	at org.apache.camel.component.rest.RestApiProducer.process(RestApiProducer.java:39)
   	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
   	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:439)
   	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
   	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:62)
   	at org.apache.camel.processor.Pipeline.process(Pipeline.java:167)
   	at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:388)
   	at org.apache.camel.component.platform.http.vertx.VertxPlatformHttpConsumer.lambda$handleRequest$2(VertxPlatformHttpConsumer.java:184)
   	at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:313)
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   	at java.base/java.lang.Thread.run(Thread.java:834)
   
   ```
   
   When lightweight mode is enabled it invokes `disposeModel()` on the `CamelContext`, which has the effect of setting the `Model` to `null`. Thus any future invocations that require it will fail with an NPE.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org