Claus Ibsen created CAMEL-24361:
-----------------------------------
Summary: EIP model metadata does not propagate
@XmlAttribute(required = true) to generated JSON
Key: CAMEL-24361
URL: https://issues.apache.org/jira/browse/CAMEL-24361
Project: Camel
Issue Type: Bug
Components: tooling
Reporter: Claus Ibsen
The EIP model JSON metadata generator does not propagate the {{required}} flag
from {{@XmlAttribute(required = true)}} annotations in the Java model classes.
This causes the generated JSON model files to have {{"required": false}} for
options that are actually required.
For example:
- {{SetHeaderDefinition.name}} has {{@XmlAttribute(required = true)}} but
{{setHeader.json}} has {{"required": false}} for {{name}}
- {{LogDefinition.message}} has {{@XmlAttribute(required = true)}} but
{{log.json}} has {{"required": false}} for {{message}}
- Many other EIPs are affected: {{setVariable}}, {{removeVariable}},
{{convertHeaderTo}}, {{process}}, {{setExchangePattern}},
{{interceptSendToEndpoint}}, etc.
This impacts tooling that uses the catalog metadata to indicate required
options to users (e.g. the TUI source editor tab completion popup shows
required options in bold at the top of the list).
The fix should be in the {{camel-package-maven-plugin}} model generation to
read the {{@XmlAttribute(required)}} annotation and set the {{required}} field
accordingly in the generated JSON.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)