Uh oh!
There was an error while loading. Please reload this page.
[docs] Add REST management OpenAPI - #9406
Conversation
| $ref: '#/components/schemas/PermissionColumns' | ||
| expireTime: | ||
| type: string | ||
| format: date-time |
There was a problem hiding this comment.
format: date-time is wider than what the implementation takes: PermissionAssignment.validateExpireTime requires instant.getNano() % 1_000_000 == 0, so a generated or non-Java client sending 2027-01-01T00:00:00.123456Z produces an OpenAPI-valid grant that the Java implementation rejects. Could this be constrained to the Z form with at most three fractional digits, and reused for the listed assignment so both directions agree?
There was a problem hiding this comment.
Fixed in 75e1a415ed. Both GrantPermissionRequest.expireTime and PermissionAssignment.expireTime now reference a shared ExpireTime schema constrained to UTC Z with zero to three fractional digits. The validator covers accepted second/millisecond forms and rejects microseconds and offset timestamps; the REST management documentation now states the same wire rule.
| required: [type] | ||
| properties: | ||
| type: | ||
| const: CATALOG |
There was a problem hiding this comment.
These const properties have no type: string. rest-catalog-open-api.yaml declares them the other way — action: { type: string, const: "setOption" } — and the difference bites here because the branches are otherwise identical: CatalogResource/CatalogAllResource, DatabaseResource/DatabaseAllResource, and TableResource/ColumnResource differ only by the constant. A generator that keys off type then sees an ambiguous oneOf and reports multiple matches for valid JSON, so a generated PermissionResource model can't deserialize.
Same pattern in 11 places — the eight PermissionResource branches plus RowFilterPolicyIdentity, ColumnMaskPolicyIdentity, and TablePolicyResource. Worth matching the catalog contract with type: string, or a single-value enum?
There was a problem hiding this comment.
Fixed in 904e19056a. All eight PermissionResource branches, both policy identity branches, and TablePolicyResource now declare type: string alongside their single-value const; the internal COLUMN assignment condition was aligned as well. The contract validator now checks every public discriminator name and constant explicitly, so the oneOf branches remain generator-distinguishable.
plusplusjiajia
commented
Aug 26, 2026
LGTM +1 |
Uh oh!
There was an error while loading. Please reload this page.
Purpose
Add an experimental OpenAPI 3.1 contract and documentation for REST permission and table data-policy management. This is the third change in the split series following #9393 and #9400.
Changes
rest-management-open-api.yamlwith six permission and policy operationsPOST .../policies/dropfor body-bearing policy removalScope
This PR contains only the language-neutral REST contract and its documentation. The test REST server implementation and Spark SQL procedures will follow in the next PR.
Tests
yarn --cwd docs test:rest-openapiyarn --cwd docs build