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

Claus Ibsen commented on CAMEL-25593:
-------------------------------------

Thanks for the report. This is reproducible on Camel 4.22.x, and it is fixed in 
Camel 4.23.0 by CAMEL-25255.

With 4.23.0, {{camel validate normalize}} writes the verbs of a rest by their 
kind ({{get:}}, {{post:}}, ...) instead of under {{verbs:}}, and their 
parameters as {{param:}} instead of {{params:}}. The normalized file then 
validates and loads again. I checked this with your example.

About {{required: true}} being dropped: {{true}} is the default for a rest 
param, so the normalizer leaves it out. The normalized param is still required.

We will not backport this to the 4.22.x LTS line. The fix is part of a larger 
rework of the YAML model writer (CAMEL-25255), so backporting it is a bigger 
effort. Please upgrade to 4.23.0 once it is released.

_Claude Code on behalf of Claus Ibsen_

> camel validate normalize for rest verbs fails
> ---------------------------------------------
>
>                 Key: CAMEL-25593
>                 URL: https://issues.apache.org/jira/browse/CAMEL-25593
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jbang
>    Affects Versions: 4.22.1
>            Reporter: Cameron Fitzwater
>            Priority: Minor
>
> When performing:
> camel validate normalize new.camel.yaml
> On:
> {code:java}
> - rest:
>     path: "/"
>     produces: "application/json"
>     get:
>       - id: "getHydroSnapshots"
>         path: "/snapshots"
>         param:
>           - type: "query"
>             name: "set"
>             description: "Options: ferc, noaa"
>             required: true
>         to: "direct:get-pi-values"{code}
> Generates:
> {code:java}
> - rest:
>     path: /
>     produces: application/json
>     verbs:
>       - id: getHydroSnapshots
>         path: /snapshots
>         params:
>           - description: "Options: ferc, noaa"
>             name: set
>             type: query
>         to:
>           uri: direct
>           parameters:
>             name: get-pi-values{code}
>  .. and fails with:
> {noformat}
> Caused by: Unsupported field: verbs
>  in file:new-normalize.camel.yaml, line 5, column 7:
>           - id: getHydroSnapshots
>           ^{noformat}
> Sidenote: `required` appears to be getting dropped to, but my assumption 
> there is that is due to it not being a supported field.



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

Reply via email to