Skip to content

chore: camel-spring-boot-generator - resolve enum default value to the actual enum constant - #2061

Closed
davsclaus wants to merge 1 commit into
mainfrom
chore/generator-enum-default-case
Closed

davsclaus wants to merge 1 commit into
mainfrom
chore/generator-enum-default-case

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

Summary

mvn clean install -P fastinstall failed to compile camel-langchain4j-agent-starter after CAMEL-24767 (tool search support) in Camel core:

LangChain4jAgentComponentConfiguration.java:[153,75] cannot find symbol
  symbol:   variable keyword
  location: class org.apache.camel.component.ai.tool.AiToolSearchStrategy

In Camel core the option is declared as @UriParam(enums = "keyword,vector", defaultValue = "keyword"), but the Java enum constants are KEYWORD / VECTOR. The generator used the documented default value as-is in the Java literal, so it generated AiToolSearchStrategy.keyword.

Changes

  • SpringBootAutoConfigurationMojo: new enumConstantName() helper that loads the enum class and resolves the default value to the enum constant with the same name, ignoring case. If no constant matches, the value is used as-is, so starters that already compiled generate the same code.
  • The generated LangChain4jAgentComponentConfiguration now uses AiToolSearchStrategy.KEYWORD. Users can still set keyword / vector in properties, because Spring Boot binds enum values ignoring case.
  • Regen for the latest Camel core changes: the ai-tool and langchain4j-agent starters and docs, the catalog jsons (ai-tool, aws2-polly, langchain4j-agent, llm, openai, spring-ai-chat) and camel-spring-boot-dependencies.

Testing

  • mvn clean install -P fastinstall failed at camel-langchain4j-agent-starter. After the fix, the resumed build (-rf :camel-langchain4j-agent-starter) completed successfully.

Claude Code on behalf of Claus Ibsen

🤖 Generated with Claude Code

…e actual enum constant

The generated starter configuration used the documented enum value as-is
as Java literal, which fails to compile when the documented values use
another case than the enum constants, such as toolSearchStrategy in
camel-langchain4j-agent (keyword vs AiToolSearchStrategy.KEYWORD).

Also regen for latest Camel core changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@davsclaus
davsclaus requested review from Croway and oscerd October 26, 2026 15:39
@davsclaus

Copy link
Copy Markdown
Contributor Author

Superseded by the fix in Camel core (apache/camel#28528), which aligned the toolSearchStrategy enum values with the enum constants. The regen will be done as chore commits on main.

Claude Code on behalf of Claus Ibsen

@davsclaus davsclaus closed this Oct 26, 2026
@davsclaus
davsclaus deleted the chore/generator-enum-default-case branch October 26, 2026 19:28
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