davsclaus opened a new pull request, #26362:
URL: https://github.com/apache/camel/pull/26362
The YAML validator post-filters the schema library's errors so each one says
what to write, instead of "property 'x' is not defined in the schema and the
schema does not allow additional properties":
- a step written as a property of the previous step, and a list written as a
map (`beans`, `when`, `steps`, `onException`)
- a string property written as a language map (`message: {simple: ...}`) and
an expression written as a plain string
- a script written as `simple:`, the `expression:` wrapper, `script:` as a
language key
- an unknown property with the nearest name from the schema for that node
- the `circuitBreaker` and `onException` shapes, `handled: true` as a
predicate
- a value continuing after its closing quote, a Groovy GString mistaken for
Simple, a file with no YAML, a second document, a jbang directive
- the expression an EIP requires (every `ExpressionNode` except `sort`),
reported once instead of as `oneOf` noise
Noise from `oneOf` branches is filtered so one error is reported per node.
Found while benchmarking a local model against the Camel MCP server
(CAMEL-24698): these were the messages a model looped on, and each one reads
the same for a person writing YAML by hand or in an editor.
Tests: the whole `camel-yaml-dsl-validator` module (`YamlValidator*Test`,
63).
Note for review: about eighteen hints are branches in four methods
(`withStepHints`, `withListHint`, `withPropertyHint`, `withExpressionHint`)
keyed on the error's keyword and path. A table-driven form was left out to keep
this PR to the behaviour; it is the tidy-up noted on CAMEL-24698.
Squash of the 33 commits on the working branch; the run-by-run history stays
on a local bench branch.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]