camel validate normalize
Normalize YAML routes to canonical (explicit) form
This command is provided by the validate plugin. Install it with camel plugin add validate. |
Options
| Option | Description | Default | Type |
|---|---|---|---|
| Whether to allow automatic downloading JAR dependencies (over the internet) | true | boolean |
| Make sure we use fresh (i.e. non-cached) resources | false | boolean |
| File or directory to write normalized output. If not specified, output is printed to console. | String | |
| Additional maven repositories for download on-demand (Use commas to separate multiple repositories) | String | |
| Display the help and sub-commands | boolean |
Examples
The command parses YAML routes and rewrites them in canonical form, expanding all shorthands and implicit expressions. The normalized output is valid against both the classic and canonical schemas. See YAML DSL for the differences between the classic and canonical schemas.
Normalize a YAML route and print to console:
camel validate normalize myroute.yaml Normalize and write to a file:
camel validate normalize --output normalized.yaml myroute.yaml Normalize multiple files into a directory:
camel validate normalize --output normalized/ routes/*.yaml Before and after
Given the following YAML route using classic shorthands:
- route:
from:
uri: timer:yaml
steps:
- setBody:
simple: "Hello Camel from ${routeId}"
- log: "${body}" Running camel validate normalize myroute.yaml produces the canonical form:
- route:
from:
uri: timer:yaml
steps:
- setBody:
expression:
simple:
expression: "Hello Camel from ${routeId}"
- log:
message: "${body}"