This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-jbang-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new 127cc68  CAMEL-23864: fix edi-x12-as2 and openapi/server examples 
after YAML normalization (#69)
127cc68 is described below

commit 127cc68eb84b0494697caf159c79c0bcb79b66dc
Author: Adriano Machado <[email protected]>
AuthorDate: Wed Jul 1 00:53:30 2026 -0400

    CAMEL-23864: fix edi-x12-as2 and openapi/server examples after YAML 
normalization (#69)
    
    The YAML canonical-form normalization in 60a70d8 introduced two test
    regressions, both verified against Camel 4.18.2 / Citrus 4.10.1:
    
    - edi-x12-as2: onException was moved out of the as2Error routeConfiguration
      into the route steps, causing "Route receivePurchaseOrder has no output
      processors" at startup. Restored onException (with the AS2 disposition
      FAILED script handler) into the routeConfiguration. Also fixed an invalid
      ediMessageCharset value (charset=US-ASCII -> US-ASCII) that triggered
      IllegalCharsetNameException once the route started correctly.
    
    - openapi/server: the restConfiguration with apiContextPath: openapi was
      deleted, so the spec was no longer served at /openapi and the test got
      HTTP 404. Restored the restConfiguration block.
    
    Also moves the ftp example runtime dependencies from jbang.properties
    (run.deps) to camel.jbang.dependencies in application.properties.
    
    All 8 workflow test suites pass.
    
    Related to CAMEL-23863.
    
    Co-authored-by: Claude Opus 4.8 <[email protected]>
---
 edi-x12-as2/camel/edi-x12-as2.camel.yaml | 28 +++++++++++++++-------------
 ftp/application.properties               |  3 +++
 ftp/jbang.properties                     |  5 ++---
 openapi/server/petstore.camel.yaml       |  3 +++
 4 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/edi-x12-as2/camel/edi-x12-as2.camel.yaml 
b/edi-x12-as2/camel/edi-x12-as2.camel.yaml
index f7cf18c..95bb540 100644
--- a/edi-x12-as2/camel/edi-x12-as2.camel.yaml
+++ b/edi-x12-as2/camel/edi-x12-as2.camel.yaml
@@ -1,5 +1,19 @@
 - routeConfiguration:
     id: as2Error
+    onException:
+      - onException:
+          exception:
+            - java.lang.Exception
+          handled:
+            constant:
+              expression: "true"
+          steps:
+            - script:
+                expression:
+                  groovy:
+                    expression: "httpContext = 
exchangeProperties['CamelAs2.interchange']\n\
+                      
httpContext.setAttribute(org.apache.camel.component.as2.api.AS2Header.DISPOSITION_TYPE,\
+                      \ \n                         
org.apache.camel.component.as2.api.entity.AS2DispositionType.FAILED)\n"
 - route:
     id: receivePurchaseOrder
     routeConfigurationId: as2Error
@@ -11,18 +25,6 @@
         requestUriPattern: /mycorp/orders
         serverPortNumber: 8081
       steps:
-        - onException:
-            exception:
-              - java.lang.Exception
-            handled:
-              constant:
-                expression: "true"
-        - script:
-            expression:
-              groovy:
-                expression: "httpContext = 
exchangeProperties['CamelAs2.interchange']\n\
-                  
httpContext.setAttribute(org.apache.camel.component.as2.api.AS2Header.DISPOSITION_TYPE,\
-                  \ \n                         
org.apache.camel.component.as2.api.entity.AS2DispositionType.FAILED)\n"
         - to:
             uri: jms
             parameters:
@@ -89,7 +91,7 @@
               as2From: mycorp
               as2MessageStructure: PLAIN
               as2To: acme
-              ediMessageCharset: charset=US-ASCII
+              ediMessageCharset: US-ASCII
               ediMessageContentType: application/edi-x12
               from: [email protected]
               inBody: ediMessage
diff --git a/ftp/application.properties b/ftp/application.properties
index 97f3dda..128c508 100644
--- a/ftp/application.properties
+++ b/ftp/application.properties
@@ -19,3 +19,6 @@ camel.beans.poolCF.connectionIdleTimeout = 20000
 camel.component.jms.connection-factory = #bean:poolCF
 
 camel.jbang.classpathFiles=application.properties
+
+# Additional dependencies required at runtime (comma separated)
+camel.jbang.dependencies=jakarta.inject:jakarta.inject-api:2.0.1,jakarta.enterprise:jakarta.enterprise.cdi-api:4.1.0
diff --git a/ftp/jbang.properties b/ftp/jbang.properties
index a86794f..06e387f 100644
--- a/ftp/jbang.properties
+++ b/ftp/jbang.properties
@@ -1,3 +1,2 @@
-# Declare required additional dependencies for testing
-run.deps=jakarta.inject:jakarta.inject-api:2.0.1,\
-jakarta.enterprise:jakarta.enterprise.cdi-api:4.1.0
+# Additional runtime dependencies are declared via camel.jbang.dependencies
+# in application.properties (Camel JBang natively supports comma separated 
lists).
diff --git a/openapi/server/petstore.camel.yaml 
b/openapi/server/petstore.camel.yaml
index 155dd3d..78afa9e 100644
--- a/openapi/server/petstore.camel.yaml
+++ b/openapi/server/petstore.camel.yaml
@@ -1,3 +1,6 @@
+- restConfiguration:
+    clientRequestValidation: true
+    apiContextPath: openapi
 - rest:
     openApi:
       specification: petstore-api.json

Reply via email to