dimas-b commented on code in PR #4621:
URL: https://github.com/apache/polaris/pull/4621#discussion_r3377685199


##########
server-templates/pojo.mustache:
##########
@@ -90,7 +99,23 @@ It is updated to remove all swagger annotations and support 
builders and immutab
         return new Builder();
     }
     {{#hasRequired}}
-    public static Builder builder({{#requiredVars}}{{{datatypeWithEnum}}} 
{{name}}{{^-last}}, {{/-last}}{{/requiredVars}}) {
+    public static Builder 
builder({{#requiredVars}}{{#isContainer}}{{#isMap}}{{{baseType}}}<String, 
{{{items.baseType}}}>{{/isMap}}{{^isMap}}{{{baseType}}}<{{{items.baseType}}}>{{/isMap}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}
 {{name}}{{^-last}}, {{/-last}}{{/requiredVars}}) {

Review Comment:
   Ok, I confirmed that Hibernate validation works by using `system$` as the 
role name.
   
   However, the enforcement appears to be triggered on REST API endpoints like 
`PolarisPrincipalRolesApi.createPrincipalRole()`.
   
   So, TBH, I do not see much value is adding `@Valid` annotations to builder 
methods in generated API classes. Annotations of fields should be sufficient 
for Hibernate to process the at the API boundary.
   
   Subsequently, adding custom validation callbacks in builder is probably an 
overkill on top of existing Hibernate validation. WDYT?



-- 
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]

Reply via email to