Copilot commented on code in PR #13128:
URL: https://github.com/apache/gravitino/pull/13128#discussion_r4004384064


##########
docs/open-api/metalakes.yaml:
##########
@@ -337,6 +337,24 @@ components:
           type: string
           description: A comment about the Metalake
           nullable: true
+        owner:
+          type: object
+          nullable: true
+          description: >-
+            The user or group owning the metalake, populated when listing 
metalakes.
+            Null when authorization is disabled, no owner is assigned, or 
ownership
+            was not loaded by the operation.
+          required:
+            - name
+            - type
+          properties:
+            name:
+              type: string
+              description: The owner name.
+            type:
+              type: string
+              enum: [user, group]
+              description: Whether the owner is a user or a group.

Review Comment:
   This inline schema declares owner types as lowercase `user`/`group`, but the 
existing canonical `Owner` schema in `docs/open-api/owners.yaml:93-107` 
declares `USER`/`GROUP`. Since both describe the same OwnerDTO wire field, the 
generated API documentation now gives clients contradictory enum contracts; 
update the shared owner schema/examples or reference one consistent schema.



##########
common/src/main/java/org/apache/gravitino/dto/MetalakeDTO.java:
##########
@@ -45,6 +47,11 @@ public class MetalakeDTO implements Metalake {
   @JsonProperty("audit")
   private AuditDTO audit;
 
+  @Nullable
+  @JsonProperty("owner")
+  @JsonInclude(JsonInclude.Include.ALWAYS)
+  private OwnerDTO owner;

Review Comment:
   The new `owner` state is not included in `MetalakeDTO.equals()` or 
`hashCode()` (those methods still compare/hash only name, comment, properties, 
and audit). Two DTOs with different owners therefore compare equal and collide 
as map/set keys, so please update the equality contract along with this field 
(and compare owner values structurally, since `OwnerDTO` does not currently 
define value equality).



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