gnodet-bot commented on code in PR #26786:
URL: https://github.com/apache/camel/pull/26786#discussion_r4093211143
##########
components/camel-ai/camel-typesafe-ai/src/main/java/org/apache/camel/component/typesafeai/TypeSafeAiConfiguration.java:
##########
@@ -52,7 +52,7 @@ public class TypeSafeAiConfiguration implements Cloneable {
@UriParam(label = "advanced", defaultValue = "0")
private double uncertainty;
@UriParam(label = "advanced", defaultValue = "NonMatch")
- private UncertaintyPolicy uncertaintyPolicy = UncertaintyPolicy.NonMatch;
+ private UncertaintyPolicy uncertaintyPolicy = UncertaintyPolicy.NON_MATCH;
Review Comment:
⚠️ The `@UriParam(defaultValue = "NonMatch")` annotation on the preceding
line wasn't updated alongside the enum rename. The catalog generator picks this
up and produces `"defaultValue": "NonMatch"` in both JSON files while the
`enum` arrays now list `["NON_MATCH", "FAIL"]` — inconsistent.
Update the annotation and re-run `mvn generate-sources` (or whatever
code-gen goal produces `src/generated/`):
```suggestion
@UriParam(label = "advanced", defaultValue = "NON_MATCH")
private UncertaintyPolicy uncertaintyPolicy =
UncertaintyPolicy.NON_MATCH;
```
##########
components/camel-ai/camel-typesafe-ai/src/generated/resources/META-INF/org/apache/camel/component/typesafeai/typesafe-ai.json:
##########
@@ -37,7 +37,7 @@
"autowiredEnabled": { "index": 10, "kind": "property", "displayName":
"Autowired Enabled", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": true, "description":
"Whether autowiring is enabled. This is used for automatic autowiring options
(the option must be marked as autowired) by looking up in the registry to find
if there is a single instance of matching type, which then gets configured on
the component. This can be used for automatic configuring JDBC data sources,
JMS connection factories, AWS Clients, etc." },
"threshold": { "index": 11, "kind": "property", "displayName":
"Threshold", "group": "advanced", "label": "advanced", "required": false,
"type": "number", "javaType": "double", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 0.5, "configurationClass":
"org.apache.camel.component.typesafeai.TypeSafeAiConfiguration",
"configurationField": "configuration", "description": "Default inclusive
probability threshold for the TypeSafe AI language. Must be within 0,1." },
"uncertainty": { "index": 12, "kind": "property", "displayName":
"Uncertainty", "group": "advanced", "label": "advanced", "required": false,
"type": "number", "javaType": "double", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 0.0, "configurationClass":
"org.apache.camel.component.typesafeai.TypeSafeAiConfiguration",
"configurationField": "configuration", "description": "Default half-width of
the inclusive uncertainty band for the TypeSafe AI language. Zero disables the
band." },
- "uncertaintyPolicy": { "index": 13, "kind": "property", "displayName":
"Uncertainty Policy", "group": "advanced", "label": "advanced", "required":
false, "type": "enum", "javaType":
"org.apache.camel.language.typesafeai.TypeSafeAiLanguage.UncertaintyPolicy",
"enum": [ "NonMatch", "Fail" ], "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "NonMatch", "configurationClass":
"org.apache.camel.component.typesafeai.TypeSafeAiConfiguration",
"configurationField": "configuration", "description": "Default action for the
TypeSafe AI language within the uncertainty band: NonMatch or Fail." },
+ "uncertaintyPolicy": { "index": 13, "kind": "property", "displayName":
"Uncertainty Policy", "group": "advanced", "label": "advanced", "required":
false, "type": "enum", "javaType":
"org.apache.camel.language.typesafeai.TypeSafeAiLanguage.UncertaintyPolicy",
"enum": [ "NON_MATCH", "FAIL" ], "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "NonMatch", "configurationClass":
"org.apache.camel.component.typesafeai.TypeSafeAiConfiguration",
"configurationField": "configuration", "description": "Default action for the
TypeSafe AI language within the uncertainty band: NonMatch or Fail." },
Review Comment:
💡 Same `defaultValue: "NonMatch"` / `enum: ["NON_MATCH","FAIL"]`
inconsistency as in the catalog JSON. Both will be fixed by updating
`@UriParam(defaultValue = "NON_MATCH")` in `TypeSafeAiConfiguration` and
re-running code gen.
##########
catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/typesafe-ai.json:
##########
@@ -37,7 +37,7 @@
"autowiredEnabled": { "index": 10, "kind": "property", "displayName":
"Autowired Enabled", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": true, "description":
"Whether autowiring is enabled. This is used for automatic autowiring options
(the option must be marked as autowired) by looking up in the registry to find
if there is a single instance of matching type, which then gets configured on
the component. This can be used for automatic configuring JDBC data sources,
JMS connection factories, AWS Clients, etc." },
"threshold": { "index": 11, "kind": "property", "displayName":
"Threshold", "group": "advanced", "label": "advanced", "required": false,
"type": "number", "javaType": "double", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 0.5, "configurationClass":
"org.apache.camel.component.typesafeai.TypeSafeAiConfiguration",
"configurationField": "configuration", "description": "Default inclusive
probability threshold for the TypeSafe AI language. Must be within 0,1." },
"uncertainty": { "index": 12, "kind": "property", "displayName":
"Uncertainty", "group": "advanced", "label": "advanced", "required": false,
"type": "number", "javaType": "double", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 0.0, "configurationClass":
"org.apache.camel.component.typesafeai.TypeSafeAiConfiguration",
"configurationField": "configuration", "description": "Default half-width of
the inclusive uncertainty band for the TypeSafe AI language. Zero disables the
band." },
- "uncertaintyPolicy": { "index": 13, "kind": "property", "displayName":
"Uncertainty Policy", "group": "advanced", "label": "advanced", "required":
false, "type": "enum", "javaType":
"org.apache.camel.language.typesafeai.TypeSafeAiLanguage.UncertaintyPolicy",
"enum": [ "NonMatch", "Fail" ], "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "NonMatch", "configurationClass":
"org.apache.camel.component.typesafeai.TypeSafeAiConfiguration",
"configurationField": "configuration", "description": "Default action for the
TypeSafe AI language within the uncertainty band: NonMatch or Fail." },
+ "uncertaintyPolicy": { "index": 13, "kind": "property", "displayName":
"Uncertainty Policy", "group": "advanced", "label": "advanced", "required":
false, "type": "enum", "javaType":
"org.apache.camel.language.typesafeai.TypeSafeAiLanguage.UncertaintyPolicy",
"enum": [ "NON_MATCH", "FAIL" ], "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "NonMatch", "configurationClass":
"org.apache.camel.component.typesafeai.TypeSafeAiConfiguration",
"configurationField": "configuration", "description": "Default action for the
TypeSafe AI language within the uncertainty band: NonMatch or Fail." },
Review Comment:
💡 The `defaultValue` field here is still `"NonMatch"` (old constant name)
while the `enum` array now correctly lists `["NON_MATCH", "FAIL"]`. This
inconsistency comes from the `@UriParam(defaultValue = "NonMatch")` annotation
not being updated — fixing that annotation and regenerating should fix both
catalog JSON files automatically.
--
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]