Marat Gubaidullin created CAMEL-24482:
-----------------------------------------

             Summary: Camel JBang YAML validator incorrectly requires all data 
formats inside unmarshal step
                 Key: CAMEL-24482
                 URL: https://issues.apache.org/jira/browse/CAMEL-24482
             Project: Camel
          Issue Type: Bug
          Components: camel-jbang
    Affects Versions: 4.22.0
            Reporter: Marat Gubaidullin


*Description:* 

When running the Camel JBang YAML validator with the {{--canonical}} flag on a 
route containing an {{unmarshal}} step, the validator incorrectly reports that 
all other possible data formats (e.g., {{{}asn1{}}}, {{{}avro{}}}, 
{{{}base64{}}}) are missing. The schema validation appears to treat all data 
formats as required properties simultaneously, rather than accepting just the 
provided format ({{{}json{}}}).

*Steps to Reproduce:*
 # Create a file named {{demo.camel.yaml}} with the following content:

{code:java}
- route:
    id: route-consumer
    from:
      id: from-de29
      uri: jms
      parameters:
        destinationName: events
        destinationType: topic
      steps:
        - unmarshal:
            id: unmarshal-4af0
            json:
              id: json-333c
{code}
 # Execute the validation command:

{code:java}
jbang "-Dcamel.jbang.version=4.22.0" camel@apache/camel validate yaml 
--canonical demo.camel.yaml
{code}
*Actual Behavior:*
The validation fails with 47 errors, demanding that every other unmarshal type 
be present:
{code:java}
ERROR
Validation error detected (errors:47)
        File: demo.camel.yaml
                /0/route/from/steps/0/unmarshal: required property 'asn1' not 
found
                /0/route/from/steps/0/unmarshal: required property 'avro' not 
found
                ... [45 other missing properties reported] ...
{code}
 *Expected Behavior:*
The validation should recognize the json format as sufficient and return:
{code:java}
Validation success (files:1)
{code}



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

Reply via email to