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

Guillaume Nodet updated CAMEL-22987:
------------------------------------
    Description: 
Add a *canonical* variant of the Camel YAML DSL JSON Schema 
(camelYamlDsl-canonical.json) that removes all oneOf/anyOf/not constructs and 
implicit patterns. This results in a schema ~25% smaller that is significantly 
easier for tooling (IDEs, code generators, AI assistants) to process.

The canonical form is a strict subset of the classic form: any YAML file that 
validates against the canonical schema will also validate against the classic 
schema and work with the Camel runtime.

Changes:
- Schema generator: new canonical parameter in GenerateYamlSchemaMojo
- Canonical schema: generated at schema/camelYamlDsl-canonical.json
- YamlValidator: supports both schemas via new YamlValidator(canonical) 
constructor
- JBang: camel validate yaml --canonical (validates against canonical schema)
- JBang: camel validate normalize (rewrites YAML from shorthand to canonical 
form)
- Documentation: Schema Variants section with side-by-side examples, IDE guide, 
command reference pages

The classic schema remains the default everywhere. Whether to make canonical 
the default is an open community discussion.

PR: https://github.com/apache/camel/pull/22059

  was:
It may be worth to have a stricter and more tooling friendly spec that is not 
overly complex and have baggage with the implicit vs explicit.

Then the existing can be there as a classic spec for people that may have hand 
coded some yaml files. But tooling and newer developers can be on the stricter 
spec.

 


> camel-yaml-dsl - yaml spec is overly complex and large due to implicits
> -----------------------------------------------------------------------
>
>                 Key: CAMEL-22987
>                 URL: https://issues.apache.org/jira/browse/CAMEL-22987
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-yaml-dsl
>            Reporter: Claus Ibsen
>            Priority: Major
>             Fix For: 4.x
>
>
> Add a *canonical* variant of the Camel YAML DSL JSON Schema 
> (camelYamlDsl-canonical.json) that removes all oneOf/anyOf/not constructs and 
> implicit patterns. This results in a schema ~25% smaller that is 
> significantly easier for tooling (IDEs, code generators, AI assistants) to 
> process.
> The canonical form is a strict subset of the classic form: any YAML file that 
> validates against the canonical schema will also validate against the classic 
> schema and work with the Camel runtime.
> Changes:
> - Schema generator: new canonical parameter in GenerateYamlSchemaMojo
> - Canonical schema: generated at schema/camelYamlDsl-canonical.json
> - YamlValidator: supports both schemas via new YamlValidator(canonical) 
> constructor
> - JBang: camel validate yaml --canonical (validates against canonical schema)
> - JBang: camel validate normalize (rewrites YAML from shorthand to canonical 
> form)
> - Documentation: Schema Variants section with side-by-side examples, IDE 
> guide, command reference pages
> The classic schema remains the default everywhere. Whether to make canonical 
> the default is an open community discussion.
> PR: https://github.com/apache/camel/pull/22059



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

Reply via email to