Repository navigation
Fix CI: map Beverage.kind field in BeerMapper and update semantic-agent-routing for Camel 4.24 - #305
Merged
Merged
Conversation
MapStruct treats unmapped target properties as errors (not warnings) when the annotation processor detects them. The Beverage model has a 'kind' field (generated from beverage.json via jsonschema2pojo) that was left unmapped in BeerMapper, causing the main build CI to fail. Add @mapping(target = "kind", constant = "beer") since the beverage.json already hard-codes kind="beer" for this Beer-to-Beverage mapping.
The semantic YAML DSL syntax changed during Camel 4.23 development: 'question:' was renamed to 'evaluation:'. The SemanticDefinitionDeserializer only accepts 'evaluation', 'state', and 'audit' as top-level keys in a semantic block; 'question' throws 'Unknown property' at startup. Update coordinator.yaml in the semantic-agent-routing example to use the current 'evaluation:' key.
…nges Three changes required by the camel-semantic API update in 4.24: 1. pom.xml: replace camel-typesafe-ai with camel-semantic-typesafe-ai The TypeSafe AI semantic adapter was split into a dedicated artifact (camel-semantic-typesafe-ai) in 4.24. The old camel-typesafe-ai no longer includes SemanticAdapter support. 2. application.properties: register the TypeSafe AI semantic adapter bean The adapter must be explicitly registered in the Camel registry as 'decisions' via camel.beans.decisions for the expert reference in YAML evaluations to resolve at startup. 3. coordinator.yaml: update semantic evaluation syntax for 4.24 - Rename 'question:' to 'evaluation:' (syntax renamed during 4.23 dev) - Add 'expert: decisions' to all six evaluations (now required) Build verified locally: 20 tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Three CI failures on main, all in the same PR.
1. MapStruct — unmapped target property
The
Beveragemodel is generated frombeverage.jsonviajsonschema2pojoand has akindfield. MapStruct raises an error for unmapped target properties.Fix: Add
@Mapping(target = "kind", constant = "beer")toBeerMapper.toBeverage(). Matches the value already inbeverage.json("kind": "beer").2. Semantic agent routing — three API changes in Camel 4.24
a) Unknown property 'question'
The semantic YAML DSL renamed
question:toevaluation:during 4.23 development. TheSemanticDefinitionDeserializeronly acceptsevaluation,state,audit.b) Evaluation expert is required
The
evaluation:syntax requires an explicitexpert:on each entry (was auto-discovered before).c) Missing bean registration
The TypeSafe AI adapter must be registered in the Camel registry as
decisionsviacamel.beans.decisionsinapplication.properties.d) Wrong artifact
camel-typesafe-aino longer includes theSemanticAdapter. The dedicatedcamel-semantic-typesafe-aiartifact is required (4.24 split).Fixes: pom.xml dependency update, bean registration in application.properties,
question:→evaluation:+expert: decisionson all 6 evaluations in coordinator.yaml.Verification
Both modules built and tested locally: