sfc-gh-mcollado commented on code in PR #2518:
URL: https://github.com/apache/polaris/pull/2518#discussion_r2389539046


##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/dao/entity/CreatePrincipalResult.java:
##########
@@ -67,10 +71,22 @@ private CreatePrincipalResult(
     super(returnStatus, extraInformation);
     this.principal = principal;
     this.principalSecrets = principalSecrets;
+    validate();

Review Comment:
   I'm quite hesitant to add this `validate` function here, given that the 
constructor is annotated to be a JSON deserializer. If the JSON structure 
doesn't adhere to the requirements (and, as it could have been generated by an 
older or newer version of the software, it's entirely plausible), we may throw 
an exception during response serialization rather than allowing the caller to 
validate the state of the response. 
   
   I'd say just remove this method from this constructor, but it seems that 
this is really the _only_ constructor that could possibly need this validation, 
as the other two never support a non-successful state with an entity or a 
successful state with no entity.



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