Skip to content

Fix CI: map Beverage.kind field in BeerMapper and update semantic-agent-routing for Camel 4.24 - #305

Merged
gnodet merged 3 commits into
apache:mainfrom
gnodet:fix/mapstruct-unmapped-kind
Nov 14, 2026
Merged

gnodet merged 3 commits into
apache:mainfrom
gnodet:fix/mapstruct-unmapped-kind

Conversation

@gnodet

@gnodet gnodet commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Three CI failures on main, all in the same PR.


1. MapStruct — unmapped target property

Unmapped target property: "kind"

The Beverage model is generated from beverage.json via jsonschema2pojo and has a kind field. MapStruct raises an error for unmapped target properties.

Fix: Add @Mapping(target = "kind", constant = "beer") to BeerMapper.toBeverage(). Matches the value already in beverage.json ("kind": "beer").


2. Semantic agent routing — three API changes in Camel 4.24

a) Unknown property 'question'
The semantic YAML DSL renamed question: to evaluation: during 4.23 development. The SemanticDefinitionDeserializer only accepts evaluation, state, audit.

b) Evaluation expert is required
The evaluation: syntax requires an explicit expert: on each entry (was auto-discovered before).

c) Missing bean registration
The TypeSafe AI adapter must be registered in the Camel registry as decisions via camel.beans.decisions in application.properties.

d) Wrong artifact
camel-typesafe-ai no longer includes the SemanticAdapter. The dedicated camel-semantic-typesafe-ai artifact is required (4.24 split).

Fixes: pom.xml dependency update, bean registration in application.properties, question: → evaluation: + expert: decisions on all 6 evaluations in coordinator.yaml.


Verification

Both modules built and tested locally:

  • mapstruct: BUILD SUCCESS
  • semantic-agent-routing: BUILD SUCCESS, 20 tests pass, 1 skipped (requires live decision service)

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.
@gnodet gnodet changed the title Fix CI: map Beverage.kind field in BeerMapper Fix CI: map Beverage.kind field in BeerMapper and update semantic YAML syntax Nov 13, 2026
…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.
@gnodet gnodet changed the title Fix CI: map Beverage.kind field in BeerMapper and update semantic YAML syntax Fix CI: map Beverage.kind field in BeerMapper and update semantic-agent-routing for Camel 4.24 Nov 13, 2026
@gnodet
gnodet merged commit 8b9a291 into apache:main Nov 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant