Copilot commented on code in PR #4819:
URL: https://github.com/apache/solr/pull/4819#discussion_r3933616428
##########
solr/solrj/src/resources/java-template/api.mustache:
##########
@@ -181,11 +181,11 @@ public class {{classname}} {
// TODO find a way to add required parameters in the request body
to the class constructor
{{#description}}
/**
- * @param {{baseName}} {{description}}
+ * @param {{name}} {{description}}
*/
{{/description}}
- public void {{setter}}({{{dataType}}} {{baseName}}) {
- this.requestBody.{{baseName}} = {{baseName}};
+ public void {{setter}}({{{dataType}}} {{name}}) {
+ this.requestBody.{{name}} = {{name}};
Review Comment:
Using Codegen's `name` as the target member assumes every wire property
sanitizes to the existing model field name. That is false for request bodies
already generated here: `UpsertFieldTypeOperation` declares
`@JsonProperty("class") public String className`, so the generated setter name
is derived from the wire property `class` while `requestBody` has only
`className`. This makes the generated `UpdateSchemaApi` source reference a
nonexistent/reserved-word-adjusted member and fail compilation. Please preserve
an explicit mapping to the source member (or align the model/template contract)
while handling the new kebab-case Schema Designer properties.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]