davsclaus opened a new pull request, #26355: URL: https://github.com/apache/camel/pull/26355
## Summary [CAMEL-24697](https://issues.apache.org/jira/browse/CAMEL-24697), split out of CAMEL-24693: three cases where `camel validate yaml` rejected EIP documentation examples that the runtime accepts, or where the docs showed a form the runtime does not accept. ### 1. `inheritErrorHandler` on `circuitBreaker` and `failoverLoadBalancer` `GenerateYamlSchemaMojo` skipped `inheritErrorHandler` for every definition except one whose `@YamlType` nodes contain `loadBalance`. `LoadBalanceDefinition` does not declare the option at all, so that branch never fired. The only two definitions that do declare it are `CircuitBreakerDefinition` and `FailoverLoadBalancerDefinition`, which are exactly the ones the EIP docs use it on, and the generated `ModelDeserializers` already accept it there. The skip is removed; the schema gains the two boolean properties. ### 2. `resequence` with the `expression:` wrapper matched two oneOf branches Every expression-carrying EIP gets a oneOf group with the inline language form, a `not` branch that excludes all alternatives, and the `expression:` wrapper. The `not` branch was built from `makeOptional`, which is only called for optional alternatives. The expression of `ResequenceDefinition` (and of `PropertyExpressionDefinition`, the entries of setHeaders/setVariables) is `required = true`, so it was missing from the exclusion list and the wrapper form matched both the `not` branch and the wrapper branch. The generator now runs a post-pass over each oneOf group: if the group has a `not` branch, that branch is completed with every alternative of the group. Groups without an optional alternative, such as the data formats of `marshal` / `unmarshal`, have no `not` branch and are unchanged, so `marshal: {}` is still rejected. The schema diff is the two added `"required": ["expression"]` entries, nothing else. For resequence this was masked most of the time: its two oneOf groups (expression, batchConfig/streamConfig) are joined with `anyOf`, so the failure only surfaced when the config group also failed, e.g. on `batchTimeout: 4000` (integer where the schema says string). That is why 8 of the 11 resequence examples failed and 3 passed. The `anyOf` join is pre-existing and left alone here, since Kaoto and other consumers parse the `anyOf`/`oneOf` shape; noted on the JIRA as a follow-up. ### 3. `jaxb` needs a `contextPath` `JaxbDataFormat.contextPath` is `required = true` in the model and `use="required"` in the XSD, but the marshal and unmarshal EIP pages showed `.jaxb()`, `<jaxb/>` and `jaxb: {}` with no context path. The runtime only falls back to an empty `JAXBContext` in that case, which cannot marshal anything, so the docs were wrong rather than the schema. All three DSL tabs on both pages now pass a context path. Catalog doc mirror regenerated. ## Verification - New `YamlValidatorSchemaGroupsTest` in camel-yaml-dsl-validator covers the three cases (wrapper form with a required expression, the exclusion list of resequence and setHeaders entries, `marshal: {}` still rejected, `inheritErrorHandler` on both definitions). The `inheritErrorHandler` resource fails against the schema on `main`. - camel-yaml-dsl-validator: 33 tests pass. camel-yaml-dsl-maven-plugin tests pass. - With the rebuilt schema, all 11 resequence doc examples and the marshal/unmarshal examples validate with `camel validate yaml`. The only remaining messages on the fault-tolerance, resilience4j and failoverLoadBalancer pages are scalar-type ones (`inheritErrorHandler: "true"` and friends), which is CAMEL-24694 / #26351. ## Note for #26351 (CAMEL-24694) Once both are merged, `YamlValidator.isRuntimeAcceptedScalar` must not accept a property placeholder at `circuitBreaker.inheritErrorHandler` or `failoverLoadBalancer.inheritErrorHandler`: both are still converted eagerly with `Boolean.valueOf` while deserializing (CAMEL-24696), so a placeholder there silently evaluates to `false`. Whichever of the two PRs merges second should carry that exclusion. No upgrade guide entry: the schema only gains properties, and no existing valid document becomes invalid. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
