[jira] [Commented] (CAMEL-21076) camel-openapi-java: Incorrect schema is generated for array type request

2024-08-13 Thread Claus Ibsen (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-21076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873122#comment-17873122
 ] 

Claus Ibsen commented on CAMEL-21076:
-

There is also an outType can you take a look at that too, and if it also need 
some fixing

> camel-openapi-java: Incorrect schema is generated for array type request 
> -
>
> Key: CAMEL-21076
> URL: https://issues.apache.org/jira/browse/CAMEL-21076
> Project: Camel
>  Issue Type: Bug
>  Components: camel-openapi-java
>Affects Versions: 3.x, 4.x
>Reporter: Iliya Grushevskiy
>Priority: Major
> Fix For: 4.8.0
>
> Attachments: 
> CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request.patch
>
>
> When specifying an array of objects as a request type (in PUT/POST methods), 
> the generated OpenAPI schema does not match the expected result.
> For example:
> {code:java}
> .post()
>   .type(User[].class)
>   .to("bean:"){code}
> Will generate:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "string"
>   }
> }
>   },
>   "required" : true
> }, {code}
> While expected schema should be:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "array",
> "items" : {
>   "$ref" : "#/components/schemas/User"
> }
>   }
> }
>   },
>   "required" : true
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CAMEL-21076) camel-openapi-java: Incorrect schema is generated for array type request

2024-08-13 Thread Iliya Grushevskiy (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-21076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873126#comment-17873126
 ] 

Iliya Grushevskiy commented on CAMEL-21076:
---

Ok. I will check it.

> camel-openapi-java: Incorrect schema is generated for array type request 
> -
>
> Key: CAMEL-21076
> URL: https://issues.apache.org/jira/browse/CAMEL-21076
> Project: Camel
>  Issue Type: Bug
>  Components: camel-openapi-java
>Affects Versions: 3.x, 4.x
>Reporter: Iliya Grushevskiy
>Priority: Major
> Fix For: 4.8.0
>
> Attachments: 
> CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request.patch
>
>
> When specifying an array of objects as a request type (in PUT/POST methods), 
> the generated OpenAPI schema does not match the expected result.
> For example:
> {code:java}
> .post()
>   .type(User[].class)
>   .to("bean:"){code}
> Will generate:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "string"
>   }
> }
>   },
>   "required" : true
> }, {code}
> While expected schema should be:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "array",
> "items" : {
>   "$ref" : "#/components/schemas/User"
> }
>   }
> }
>   },
>   "required" : true
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CAMEL-21076) camel-openapi-java: Incorrect schema is generated for array type request

2024-08-13 Thread Iliya Grushevskiy (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-21076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873131#comment-17873131
 ] 

Iliya Grushevskiy commented on CAMEL-21076:
---

Out type seems fine. I added check in test for out type array.

 

[^CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request1.patch]

> camel-openapi-java: Incorrect schema is generated for array type request 
> -
>
> Key: CAMEL-21076
> URL: https://issues.apache.org/jira/browse/CAMEL-21076
> Project: Camel
>  Issue Type: Bug
>  Components: camel-openapi-java
>Affects Versions: 3.x, 4.x
>Reporter: Iliya Grushevskiy
>Priority: Major
> Fix For: 4.8.0
>
> Attachments: 
> CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request.patch,
>  
> CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request1.patch
>
>
> When specifying an array of objects as a request type (in PUT/POST methods), 
> the generated OpenAPI schema does not match the expected result.
> For example:
> {code:java}
> .post()
>   .type(User[].class)
>   .to("bean:"){code}
> Will generate:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "string"
>   }
> }
>   },
>   "required" : true
> }, {code}
> While expected schema should be:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "array",
> "items" : {
>   "$ref" : "#/components/schemas/User"
> }
>   }
> }
>   },
>   "required" : true
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (CAMEL-21076) camel-openapi-java: Incorrect schema is generated for array type request

2024-08-13 Thread Iliya Grushevskiy (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-21076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Iliya Grushevskiy updated CAMEL-21076:
--
Attachment: 
CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request1.patch

> camel-openapi-java: Incorrect schema is generated for array type request 
> -
>
> Key: CAMEL-21076
> URL: https://issues.apache.org/jira/browse/CAMEL-21076
> Project: Camel
>  Issue Type: Bug
>  Components: camel-openapi-java
>Affects Versions: 3.x, 4.x
>Reporter: Iliya Grushevskiy
>Priority: Major
> Fix For: 4.8.0
>
> Attachments: 
> CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request.patch,
>  
> CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request1.patch
>
>
> When specifying an array of objects as a request type (in PUT/POST methods), 
> the generated OpenAPI schema does not match the expected result.
> For example:
> {code:java}
> .post()
>   .type(User[].class)
>   .to("bean:"){code}
> Will generate:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "string"
>   }
> }
>   },
>   "required" : true
> }, {code}
> While expected schema should be:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "array",
> "items" : {
>   "$ref" : "#/components/schemas/User"
> }
>   }
> }
>   },
>   "required" : true
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Assigned] (CAMEL-21054) camel-core-model - Can we make pollEnrich for static uri

2024-08-13 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-21054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen reassigned CAMEL-21054:
---

Assignee: Claus Ibsen

> camel-core-model - Can we make pollEnrich for static uri
> 
>
> Key: CAMEL-21054
> URL: https://issues.apache.org/jira/browse/CAMEL-21054
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-core
>Reporter: Claus Ibsen
>Assignee: Claus Ibsen
>Priority: Minor
>
> When using pollEnrich EIP / enrich EIP then they use a language for URI. 
> However we may want to have a variation that are like `to` with a static uri.
> This makes it easier for tooling so they can have a UI that works better. So 
> pollEnrich can be either in static or dynamic mode, and in static mode the UI 
> tooling can be more powerful as it would be able to have a component specific 
> UI instead of just a dynamic form for typing in a simple uri language.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Assigned] (CAMEL-21001) camel-jbang: Kubernetes plugin: Add Route trait

2024-08-13 Thread Gaelle Fournier (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-21001?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gaelle Fournier reassigned CAMEL-21001:
---

Assignee: Gaelle Fournier

> camel-jbang: Kubernetes plugin: Add Route trait
> ---
>
> Key: CAMEL-21001
> URL: https://issues.apache.org/jira/browse/CAMEL-21001
> Project: Camel
>  Issue Type: New Feature
>  Components: camel-jbang
>Reporter: Gaëlle Fournier
>Assignee: Gaelle Fournier
>Priority: Major
> Fix For: 4.x
>
>
> We should enhance Camel JBang Kubernetes plugin with an Route trait that is 
> capable of configuring the Kubenetes Route resource (from apiVersion 
> route.openshift.io/v1) that should be part of the Kubernetes manifest.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (CAMEL-21054) camel-core-model - Can we make pollEnrich for static uri

2024-08-13 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-21054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-21054:

Fix Version/s: 4.8.0

> camel-core-model - Can we make pollEnrich for static uri
> 
>
> Key: CAMEL-21054
> URL: https://issues.apache.org/jira/browse/CAMEL-21054
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-core
>Reporter: Claus Ibsen
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: 4.8.0
>
>
> When using pollEnrich EIP / enrich EIP then they use a language for URI. 
> However we may want to have a variation that are like `to` with a static uri.
> This makes it easier for tooling so they can have a UI that works better. So 
> pollEnrich can be either in static or dynamic mode, and in static mode the UI 
> tooling can be more powerful as it would be able to have a component specific 
> UI instead of just a dynamic form for typing in a simple uri language.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (CAMEL-20782) camel-test-infra-mongodb: MongoDB 5 requires hosts with AVX

2024-08-13 Thread Otavio Rodolfo Piske (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-20782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Otavio Rodolfo Piske resolved CAMEL-20782.
--
Fix Version/s: 4.7.0
 Assignee: Otavio Rodolfo Piske
   Resolution: Fixed

Fixed by infra by enabling AVX nodes for Camel.

> camel-test-infra-mongodb: MongoDB 5 requires hosts with AVX
> ---
>
> Key: CAMEL-20782
> URL: https://issues.apache.org/jira/browse/CAMEL-20782
> Project: Camel
>  Issue Type: Task
>  Components: camel-mongodb, camel-mongodb-gridfs
>Reporter: Otavio Rodolfo Piske
>Assignee: Otavio Rodolfo Piske
>Priority: Major
> Fix For: 4.7.0
>
>
> Mongo 5+ needs AVX-capable hosts to run. Because many of the x86 nodes on the 
> ASF CI don't have that enabled, this causes all of MongoDB tests to fail.
>  
> {code:java}
> 2024-05-17 02:59:19,144 [main ] ERROR 9-jammy - Could not start container 
> java.lang.IllegalStateException: Wait strategy failed. Container exited with 
> code 132 at 
> org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:533)
>  ~[testcontainers-1.19.8.jar:1.19.8] at 
> org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:354)
>  ~[testcontainers-1.19.8.jar:1.19.8] at 
> org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
>  ~[duct-tape-1.0.8.jar:?] at 
> org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:344)
>  ~[testcontainers-1.19.8.jar:1.19.8] at 
> org.testcontainers.containers.GenericContainer.start(GenericContainer.java:330)
>  ~[testcontainers-1.19.8.jar:1.19.8] at 
> org.apache.camel.test.infra.mongodb.services.MongoDBLocalContainerService.initialize(MongoDBLocalContainerService.java:74)
>  ~[camel-test-infra-mongodb-4.7.0-SNAPSHOT-tests.jar:4.7.0-SNAPSHOT] at 
> org.apache.camel.test.infra.common.services.SingletonService.doInitializeService(SingletonService.java:54)
>  ~[camel-test-infra-common-4.7.0-SNAPSHOT-tests.jar:4.7.0-SNAPSHOT] at 
> org.junit.platform.engine.support.store.NamespacedHierarchicalStore.lambda$getOrComputeIfAbsent$5(NamespacedHierarchicalStore.java:147)
>  ~[junit-platform-engine-1.10.2.jar:1.10.2] at 
> org.junit.platform.engine.support.store.NamespacedHierarchicalStore$MemoizingSupplier.computeValue(NamespacedHierarchicalStore.java:372)
>  ~[junit-platform-engine-1.10.2.jar:1.10.2] at 
> org.junit.platform.engine.support.store.NamespacedHierarchicalStore$MemoizingSupplier.get(NamespacedHierarchicalStore.java:361)
>  ~[junit-platform-engine-1.10.2.jar:1.10.2] at 
> org.junit.platform.engine.support.store.NamespacedHierarchicalStore$StoredValue.evaluate(NamespacedHierarchicalStore.java:308)
>  ~[junit-platform-engine-1.10.2.jar:1.10.2] at 
> org.junit.platform.engine.support.store.NamespacedHierarchicalStore$StoredValue.access$200(NamespacedHierarchicalStore.java:287)
>  ~[junit-platform-engine-1.10.2.jar:1.10.2] at 
> org.junit.platform.engine.support.store.NamespacedHierarchicalStore.getOrComputeIfAbsent(NamespacedHierarchicalStore.java:149)
>  ~[junit-platform-engine-1.10.2.jar:1.10.2] at 
> org.junit.jupiter.engine.execution.NamespaceAwareStore.lambda$getOrComputeIfAbsent$2(NamespaceAwareStore.java:57)
>  ~[junit-jupiter-engine-5.10.2.jar:5.10.2] at 
> org.junit.jupiter.engine.execution.NamespaceAwareStore.accessStore(NamespaceAwareStore.java:90)
>  ~[junit-jupiter-engine-5.10.2.jar:5.10.2] at 
> org.junit.jupiter.engine.execution.NamespaceAwareStore.getOrComputeIfAbsent(NamespaceAwareStore.java:57)
>  ~[junit-jupiter-engine-5.10.2.jar:5.10.2] at 
> org.apache.camel.test.infra.common.services.SingletonService.addToStore(SingletonService.java:47)
>  ~[camel-test-infra-common-4.7.0-SNAPSHOT-tests.jar:4.7.0-SNAPSHOT] at 
> org.apache.camel.test.infra.common.services.SingletonService.beforeAll(SingletonService.java:60)
>  ~[camel-test-infra-common-4.7.0-SNAPSHOT-tests.jar:4.7.0-SNAPSHOT] at 
> org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$12(ClassBasedTestDescriptor.java:396)
>  ~[junit-jupiter-engine-5.10.2.jar:5.10.2] at 
> org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>  ~[junit-platform-engine-1.10.2.jar:1.10.2] at 
> org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:396)
>  ~[junit-jupiter-engine-5.10.2.jar:5.10.2] at 
> org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:212)
>  ~[junit-jupiter-engine-5.10.2.jar:5.10.2] at 
> org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:85)
>  ~[junit-jupiter-engine-5.10.2.jar:5.10.2] at 
> org.junit.platform.engine.support.hierarchical.NodeT

[jira] [Resolved] (CAMEL-20113) camel-tests: investigate consolidating tests

2024-08-13 Thread Otavio Rodolfo Piske (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-20113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Otavio Rodolfo Piske resolved CAMEL-20113.
--
Fix Version/s: 4.6.0
 Assignee: Ivan Kulaga
   Resolution: Fixed

Resolved with multiple patches from [~ikulaga]

> camel-tests: investigate consolidating tests
> 
>
> Key: CAMEL-20113
> URL: https://issues.apache.org/jira/browse/CAMEL-20113
> Project: Camel
>  Issue Type: Task
>  Components: camel-itests, tests
>Reporter: Otavio Rodolfo Piske
>Assignee: Ivan Kulaga
>Priority: Minor
>  Labels: help-wanted
> Fix For: 4.6.0
>
>
> We should revise the the tests in camel/tests. Some of them are old, invalid 
> and/or duplicated with component tests. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (CAMEL-21036) Recovering cloud native properties

2024-08-13 Thread Pasquale Congiusti (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-21036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pasquale Congiusti resolved CAMEL-21036.

Resolution: Fixed

> Recovering cloud native properties
> --
>
> Key: CAMEL-21036
> URL: https://issues.apache.org/jira/browse/CAMEL-21036
> Project: Camel
>  Issue Type: New Feature
>Reporter: Pasquale Congiusti
>Assignee: Pasquale Congiusti
>Priority: Major
> Fix For: 4.8.0
>
>
> When we run a Camel application on the cloud we may leverage the cloud native 
> way of setting configuration. For example, when running on Kubernetes we may 
> leverage the configmap and secret which are typically mounted as a key/value 
> files.
> Given the following Secret:
> {code}
> apiVersion: v1
> data:
>   org.acme.my-key: czNjcjN0
> kind: Secret
> ...
> {code}
> and the following Camel application Deployment volume mounted leveraging such 
> a secret:
> {code}
>   volumeMounts:
>   - mountPath: /etc/camel/conf.d/_secret/my-properties
> name: my-properties
> readOnly: true
> {code}
> We may expect that at startup, the application scans a given directory (ie 
> /etc/camel/conf.d/_configmaps|_secrets/) and add the parameter to the regular 
> properties available to the context. From that moment onward, the application 
> could leverage the properties placeholder, ie using {{org.acme.my-key}}.
> Ideally we should have a couple of properties to control the behavior, ie:
> cloud.config.scan=false (not sure if enable this by default)
> cloud.config.location=/etc/camel/conf.d



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CAMEL-21077) Camel-upgrade-recipes: cover upgrading camel 4.6 to 4.7

2024-08-13 Thread Jiri Ondrusek (Jira)
Jiri Ondrusek created CAMEL-21077:
-

 Summary: Camel-upgrade-recipes: cover upgrading camel 4.6 to 4.7
 Key: CAMEL-21077
 URL: https://issues.apache.org/jira/browse/CAMEL-21077
 Project: Camel
  Issue Type: Task
  Components: upgrade-recipes
Reporter: Jiri Ondrusek
Assignee: Jiri Ondrusek


Cover migrations described by  [migration 
guide|https://camel.apache.org/manual/camel-4x-upgrade-guide-4_7.html#_upgrading_camel_4_6_to_4_7]

(Only a few of migration can be covered by recipes)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CAMEL-21078) camel-test-junit5: enabling adviceWith should be available for consumer code.

2024-08-13 Thread Otavio Rodolfo Piske (Jira)
Otavio Rodolfo Piske created CAMEL-21078:


 Summary: camel-test-junit5: enabling adviceWith should be 
available for consumer code.
 Key: CAMEL-21078
 URL: https://issues.apache.org/jira/browse/CAMEL-21078
 Project: Camel
  Issue Type: Bug
  Components: camel-test
Affects Versions: 4.7.0
Reporter: Otavio Rodolfo Piske
Assignee: Otavio Rodolfo Piske
 Fix For: 4.8.0


This has been reported both on 
[StackOverflow|https://stackoverflow.com/questions/78844486/how-can-i-enable-useadvicewith-in-a-cameltestsupport-unit-test]
 as well as on the users' mailing list.

Looking more closely, enabling/disabling the {{adviceWith}} is totally within 
the expectations of what users of the {{CamelTestSupport}} class are expected 
to do, therefore having it as protected is incorrect: it prevents enabling a 
user-related feature.





--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (CAMEL-21057) REST OpenApi fails to resolve host from the URL

2024-08-13 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-21057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-21057:

Fix Version/s: 4.8.0

> REST OpenApi fails to resolve host from the URL
> ---
>
> Key: CAMEL-21057
> URL: https://issues.apache.org/jira/browse/CAMEL-21057
> Project: Camel
>  Issue Type: Bug
>  Components: camel-rest-openapi
>Affects Versions: 3.18.8, 4.7.0
>Reporter: Lukas Lowinger
>Assignee: Zheng Feng
>Priority: Major
> Fix For: 4.8.0
>
> Attachments: rest-openapi-camel.zip
>
>
> Given simple route
> {code}
> private final String openApiJsonUrl = 
> "http://localhost:8080/api/v3/openapi.json";;
> String a = "{\n" + "  \"id\": 13,\n" + "  \"name\": \"kooo\",\n" + "  
> \"category\": {\n" + "\"id\": 1,\n" + "\"name\": \"Dogs\"\n" + "  
> }\n" + "}";
> @Override
> public void configure() throws Exception {
> 
> from("timer:test?repeatCount=1").setBody(simple(a)).setHeader(Exchange.CONTENT_TYPE,
>  simple("application/json")).to("rest-openapi:#addPet?specificationUri=RAW(" 
> + openApiJsonUrl + ")").to("direct:readPet");
> from("direct:readPet").setHeader("petId", 
> simple("13")).to("rest-openapi:#getPetById?specificationUri=RAW(" + 
> openApiJsonUrl + ")");
> }
> {code}
> I get 
> {code}
> Caused by: java.net.MalformedURLException: no protocol: /api/v3
> at java.net.URL. (URL.java:674)
> at java.net.URL. (URL.java:569)
> at java.net.URL. (URL.java:516)
> at 
> org.apache.camel.component.rest.openapi.RestOpenApiEndpoint.determineHost 
> (RestOpenApiEndpoint.java:590)
> at 
> org.apache.camel.component.rest.openapi.RestOpenApiEndpoint.determineEndpointParameters
>  (RestOpenApiEndpoint.java:459)
> {code}
> Reproducer:
> # Unzip  [^rest-openapi-camel.zip] 
> # Run `docker run -p 8080:8080 swaggerapi/petstore3`
> # mvn camel:run



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CAMEL-21057) REST OpenApi fails to resolve host from the URL

2024-08-13 Thread Claus Ibsen (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-21057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873235#comment-17873235
 ] 

Claus Ibsen commented on CAMEL-21057:
-

Maybe this should be backported to 4.4.x branch

> REST OpenApi fails to resolve host from the URL
> ---
>
> Key: CAMEL-21057
> URL: https://issues.apache.org/jira/browse/CAMEL-21057
> Project: Camel
>  Issue Type: Bug
>  Components: camel-rest-openapi
>Affects Versions: 3.18.8, 4.7.0
>Reporter: Lukas Lowinger
>Assignee: Zheng Feng
>Priority: Major
> Fix For: 4.8.0
>
> Attachments: rest-openapi-camel.zip
>
>
> Given simple route
> {code}
> private final String openApiJsonUrl = 
> "http://localhost:8080/api/v3/openapi.json";;
> String a = "{\n" + "  \"id\": 13,\n" + "  \"name\": \"kooo\",\n" + "  
> \"category\": {\n" + "\"id\": 1,\n" + "\"name\": \"Dogs\"\n" + "  
> }\n" + "}";
> @Override
> public void configure() throws Exception {
> 
> from("timer:test?repeatCount=1").setBody(simple(a)).setHeader(Exchange.CONTENT_TYPE,
>  simple("application/json")).to("rest-openapi:#addPet?specificationUri=RAW(" 
> + openApiJsonUrl + ")").to("direct:readPet");
> from("direct:readPet").setHeader("petId", 
> simple("13")).to("rest-openapi:#getPetById?specificationUri=RAW(" + 
> openApiJsonUrl + ")");
> }
> {code}
> I get 
> {code}
> Caused by: java.net.MalformedURLException: no protocol: /api/v3
> at java.net.URL. (URL.java:674)
> at java.net.URL. (URL.java:569)
> at java.net.URL. (URL.java:516)
> at 
> org.apache.camel.component.rest.openapi.RestOpenApiEndpoint.determineHost 
> (RestOpenApiEndpoint.java:590)
> at 
> org.apache.camel.component.rest.openapi.RestOpenApiEndpoint.determineEndpointParameters
>  (RestOpenApiEndpoint.java:459)
> {code}
> Reproducer:
> # Unzip  [^rest-openapi-camel.zip] 
> # Run `docker run -p 8080:8080 swaggerapi/petstore3`
> # mvn camel:run



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (CAMEL-21054) camel-core-model - Can we make pollEnrich for static uri

2024-08-13 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-21054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-21054.
-
Resolution: Fixed

> camel-core-model - Can we make pollEnrich for static uri
> 
>
> Key: CAMEL-21054
> URL: https://issues.apache.org/jira/browse/CAMEL-21054
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-core
>Reporter: Claus Ibsen
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: 4.8.0
>
>
> When using pollEnrich EIP / enrich EIP then they use a language for URI. 
> However we may want to have a variation that are like `to` with a static uri.
> This makes it easier for tooling so they can have a UI that works better. So 
> pollEnrich can be either in static or dynamic mode, and in static mode the UI 
> tooling can be more powerful as it would be able to have a component specific 
> UI instead of just a dynamic form for typing in a simple uri language.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Assigned] (CAMEL-21076) camel-openapi-java: Incorrect schema is generated for array type request

2024-08-13 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-21076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen reassigned CAMEL-21076:
---

Assignee: Claus Ibsen

> camel-openapi-java: Incorrect schema is generated for array type request 
> -
>
> Key: CAMEL-21076
> URL: https://issues.apache.org/jira/browse/CAMEL-21076
> Project: Camel
>  Issue Type: Bug
>  Components: camel-openapi-java
>Affects Versions: 3.x, 4.x
>Reporter: Iliya Grushevskiy
>Assignee: Claus Ibsen
>Priority: Major
> Fix For: 4.8.0
>
> Attachments: 
> CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request.patch,
>  
> CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request1.patch
>
>
> When specifying an array of objects as a request type (in PUT/POST methods), 
> the generated OpenAPI schema does not match the expected result.
> For example:
> {code:java}
> .post()
>   .type(User[].class)
>   .to("bean:"){code}
> Will generate:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "string"
>   }
> }
>   },
>   "required" : true
> }, {code}
> While expected schema should be:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "array",
> "items" : {
>   "$ref" : "#/components/schemas/User"
> }
>   }
> }
>   },
>   "required" : true
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (CAMEL-21076) camel-openapi-java: Incorrect schema is generated for array type request

2024-08-13 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-21076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-21076.
-
Resolution: Fixed

> camel-openapi-java: Incorrect schema is generated for array type request 
> -
>
> Key: CAMEL-21076
> URL: https://issues.apache.org/jira/browse/CAMEL-21076
> Project: Camel
>  Issue Type: Bug
>  Components: camel-openapi-java
>Affects Versions: 3.x, 4.x
>Reporter: Iliya Grushevskiy
>Assignee: Claus Ibsen
>Priority: Major
> Fix For: 4.8.0
>
> Attachments: 
> CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request.patch,
>  
> CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request1.patch
>
>
> When specifying an array of objects as a request type (in PUT/POST methods), 
> the generated OpenAPI schema does not match the expected result.
> For example:
> {code:java}
> .post()
>   .type(User[].class)
>   .to("bean:"){code}
> Will generate:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "string"
>   }
> }
>   },
>   "required" : true
> }, {code}
> While expected schema should be:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "array",
> "items" : {
>   "$ref" : "#/components/schemas/User"
> }
>   }
> }
>   },
>   "required" : true
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CAMEL-21076) camel-openapi-java: Incorrect schema is generated for array type request

2024-08-13 Thread Claus Ibsen (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-21076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873247#comment-17873247
 ] 

Claus Ibsen commented on CAMEL-21076:
-

Thanks for the patch

> camel-openapi-java: Incorrect schema is generated for array type request 
> -
>
> Key: CAMEL-21076
> URL: https://issues.apache.org/jira/browse/CAMEL-21076
> Project: Camel
>  Issue Type: Bug
>  Components: camel-openapi-java
>Affects Versions: 3.x, 4.x
>Reporter: Iliya Grushevskiy
>Assignee: Claus Ibsen
>Priority: Major
> Fix For: 4.8.0
>
> Attachments: 
> CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request.patch,
>  
> CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request1.patch
>
>
> When specifying an array of objects as a request type (in PUT/POST methods), 
> the generated OpenAPI schema does not match the expected result.
> For example:
> {code:java}
> .post()
>   .type(User[].class)
>   .to("bean:"){code}
> Will generate:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "string"
>   }
> }
>   },
>   "required" : true
> }, {code}
> While expected schema should be:
> {code:java}
> "requestBody" : {
>   "description" : "",
>   "content" : {
> "application/json" : {
>   "schema" : {
> "type" : "array",
> "items" : {
>   "$ref" : "#/components/schemas/User"
> }
>   }
> }
>   },
>   "required" : true
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CAMEL-21057) REST OpenApi fails to resolve host from the URL

2024-08-13 Thread Zheng Feng (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-21057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873355#comment-17873355
 ] 

Zheng Feng commented on CAMEL-21057:


Sure, I will do

> REST OpenApi fails to resolve host from the URL
> ---
>
> Key: CAMEL-21057
> URL: https://issues.apache.org/jira/browse/CAMEL-21057
> Project: Camel
>  Issue Type: Bug
>  Components: camel-rest-openapi
>Affects Versions: 3.18.8, 4.7.0
>Reporter: Lukas Lowinger
>Assignee: Zheng Feng
>Priority: Major
> Fix For: 4.8.0
>
> Attachments: rest-openapi-camel.zip
>
>
> Given simple route
> {code}
> private final String openApiJsonUrl = 
> "http://localhost:8080/api/v3/openapi.json";;
> String a = "{\n" + "  \"id\": 13,\n" + "  \"name\": \"kooo\",\n" + "  
> \"category\": {\n" + "\"id\": 1,\n" + "\"name\": \"Dogs\"\n" + "  
> }\n" + "}";
> @Override
> public void configure() throws Exception {
> 
> from("timer:test?repeatCount=1").setBody(simple(a)).setHeader(Exchange.CONTENT_TYPE,
>  simple("application/json")).to("rest-openapi:#addPet?specificationUri=RAW(" 
> + openApiJsonUrl + ")").to("direct:readPet");
> from("direct:readPet").setHeader("petId", 
> simple("13")).to("rest-openapi:#getPetById?specificationUri=RAW(" + 
> openApiJsonUrl + ")");
> }
> {code}
> I get 
> {code}
> Caused by: java.net.MalformedURLException: no protocol: /api/v3
> at java.net.URL. (URL.java:674)
> at java.net.URL. (URL.java:569)
> at java.net.URL. (URL.java:516)
> at 
> org.apache.camel.component.rest.openapi.RestOpenApiEndpoint.determineHost 
> (RestOpenApiEndpoint.java:590)
> at 
> org.apache.camel.component.rest.openapi.RestOpenApiEndpoint.determineEndpointParameters
>  (RestOpenApiEndpoint.java:459)
> {code}
> Reproducer:
> # Unzip  [^rest-openapi-camel.zip] 
> # Run `docker run -p 8080:8080 swaggerapi/petstore3`
> # mvn camel:run



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (CAMEL-21057) REST OpenApi fails to resolve host from the URL

2024-08-13 Thread Zheng Feng (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-21057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zheng Feng updated CAMEL-21057:
---
Fix Version/s: 4.4.4

> REST OpenApi fails to resolve host from the URL
> ---
>
> Key: CAMEL-21057
> URL: https://issues.apache.org/jira/browse/CAMEL-21057
> Project: Camel
>  Issue Type: Bug
>  Components: camel-rest-openapi
>Affects Versions: 3.18.8, 4.7.0
>Reporter: Lukas Lowinger
>Assignee: Zheng Feng
>Priority: Major
> Fix For: 4.4.4, 4.8.0
>
> Attachments: rest-openapi-camel.zip
>
>
> Given simple route
> {code}
> private final String openApiJsonUrl = 
> "http://localhost:8080/api/v3/openapi.json";;
> String a = "{\n" + "  \"id\": 13,\n" + "  \"name\": \"kooo\",\n" + "  
> \"category\": {\n" + "\"id\": 1,\n" + "\"name\": \"Dogs\"\n" + "  
> }\n" + "}";
> @Override
> public void configure() throws Exception {
> 
> from("timer:test?repeatCount=1").setBody(simple(a)).setHeader(Exchange.CONTENT_TYPE,
>  simple("application/json")).to("rest-openapi:#addPet?specificationUri=RAW(" 
> + openApiJsonUrl + ")").to("direct:readPet");
> from("direct:readPet").setHeader("petId", 
> simple("13")).to("rest-openapi:#getPetById?specificationUri=RAW(" + 
> openApiJsonUrl + ")");
> }
> {code}
> I get 
> {code}
> Caused by: java.net.MalformedURLException: no protocol: /api/v3
> at java.net.URL. (URL.java:674)
> at java.net.URL. (URL.java:569)
> at java.net.URL. (URL.java:516)
> at 
> org.apache.camel.component.rest.openapi.RestOpenApiEndpoint.determineHost 
> (RestOpenApiEndpoint.java:590)
> at 
> org.apache.camel.component.rest.openapi.RestOpenApiEndpoint.determineEndpointParameters
>  (RestOpenApiEndpoint.java:459)
> {code}
> Reproducer:
> # Unzip  [^rest-openapi-camel.zip] 
> # Run `docker run -p 8080:8080 swaggerapi/petstore3`
> # mvn camel:run



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (CAMEL-21078) camel-test-junit5: enabling adviceWith should be available for consumer code.

2024-08-13 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-21078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-21078.
-
Resolution: Fixed

> camel-test-junit5: enabling adviceWith should be available for consumer code.
> -
>
> Key: CAMEL-21078
> URL: https://issues.apache.org/jira/browse/CAMEL-21078
> Project: Camel
>  Issue Type: Bug
>  Components: camel-test
>Affects Versions: 4.7.0
>Reporter: Otavio Rodolfo Piske
>Assignee: Otavio Rodolfo Piske
>Priority: Major
> Fix For: 4.8.0
>
>
> This has been reported both on 
> [StackOverflow|https://stackoverflow.com/questions/78844486/how-can-i-enable-useadvicewith-in-a-cameltestsupport-unit-test]
>  as well as on the users' mailing list.
> Looking more closely, enabling/disabling the {{adviceWith}} is totally within 
> the expectations of what users of the {{CamelTestSupport}} class are expected 
> to do, therefore having it as protected is incorrect: it prevents enabling a 
> user-related feature.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)