HonahX commented on code in PR #808: URL: https://github.com/apache/polaris/pull/808#discussion_r1943668334
########## spec/rest-catalog-open-api.yaml: ########## @@ -3977,6 +4241,151 @@ components: items: type: integer description: "List of equality field IDs" + + Policy: + type: object + required: + - owner_id + - policy-id + - policy-type + - name + - content + - version + properties: + owner-id: + type: string + policy-id: + type: string + policy-type: + type: string + name: + type: string + description: + type: string + content: + $ref: '#/components/schemas/PolicyContent' + version: + type: integer + created-at-ms: + type: integer + format: int64 + updated-at-ms: + type: integer + format: int64 + + PolicyContent: {} + + CreatePolicyRequest: + type: object + required: + - name + - type + - content + properties: + name: + type: string + type: + type: string + description: + type: string + content: + $ref: '#/components/schemas/PolicyContent' + + LoadPolicyResult: + type: object + properties: + policy: + $ref: '#/components/schemas/Policy' + + UpdatePolicyRequest: + type: object + properties: + description: + type: string + content: + $ref: '#/components/schemas/PolicyContent' + + SetPolicyRequest: + type: object + required: + - entity + properties: + entity: + $ref: '#/components/schemas/EntityIdentifier' + parameters: + type: object + additionalProperties: + type: string + + UnsetPolicyRequest: + type: object + required: + - entity + properties: + entity: + $ref: '#/components/schemas/EntityIdentifier' + + CatalogIdentifier: + allOf: + - $ref: '#/components/schemas/EntityIdentifier' + - type: object + required: + - catalog + properties: + catalog: + type: string + + NamespaceIdentifier: + allOf: + - $ref: '#/components/schemas/EntityIdentifier' + - type: object + required: + - catalog + - namespace + properties: + catalog: + type: string + nullable: false + namespace: + $ref: '#/components/schemas/Namespace' + + TableLikeIdentifier: + allOf: + - $ref: '#/components/schemas/EntityIdentifier' + - type: object + required: + - catalog + - namespace + - name + properties: + catalog: + type: string + nullable: false + namespace: + $ref: '#/components/schemas/Namespace' + name: + type: string + nullable: false + + EntityIdentifier: + type: object + discriminator: + propertyName: type + mapping: + catalog: '#/components/schemas/CatalogIdentifier' + namespace: '#/components/schemas/NamespaceIdentifier' + table-like: '#/components/schemas/TableLikeIdentifier' + properties: + type: + type: string + enum: Review Comment: Hi @snazy , I gave this a second thought, and I think keeping the enum could actually be helpful. The polymorphism it provides helps us validate Identifier types and ensures we only allow these valid field combinations: - CatalogIdentifier → `catalog` - NamespaceIdentifier → `catalog`, `namespace` - TableLikeIdentifier → `catalog`, `namespace`, `name` That said, I’d like to understand more about the risks you mentioned regarding enums being "not safe for future development." My current understanding is that if we add new enum values later, older servers would simply reject them as unsupported—so I’m curious if there’s something else I’m missing. Would appreciate any insights! -- 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: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org