lasdf1234 commented on issue #14428:
URL: https://github.com/apache/gravitino/issues/14428#issuecomment-6732236651

   @markhoerth Follow-up with the concrete REST surfaces that already follow 
this convention.
   
   The Gravitino server Jackson mapper enables 
`MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS` (and writes enums lowercase). So 
for request JSON fields that bind to Java enums, callers may send any case; the 
server accepts them. Examples:
   
   - `POST /api/metalakes/{metalake}/catalogs` — body `type` (`Catalog.Type`: 
`relational` / `RELATIONAL` / …)
   - `POST /api/metalakes/{metalake}/catalogs/testConnection` — same `type` 
field
   - `POST 
/api/metalakes/{metalake}/catalogs/{catalog}/schemas/{schema}/filesets` — body 
`type` (`Fileset.Type`)
   - `PUT 
/api/metalakes/{metalake}/catalogs/{catalog}/schemas/{schema}/filesets/{fileset}`
 — update that sets `newType` (`Fileset.Type`)
   - `PUT /api/metalakes/{metalake}/owners/{metadataObjectType}/{fullName}` — 
body `type` (`Owner.Type`: `USER` / `GROUP`, any case)
   - `POST 
/api/metalakes/{metalake}/catalogs/{catalog}/schemas/{schema}/tables` — nested 
enum fields such as `distribution.strategy`, `sortOrders[].direction` / 
`nullOrdering`, `indexes[].indexType`
   - `POST /api/metalakes/{metalake}/roles` — privileges’ `name` / `condition` 
enums on securable objects
   - `POST 
/api/metalakes/{metalake}/catalogs/{catalog}/schemas/{schema}/functions` — body 
`functionType`
   - `POST /api/metalakes/{metalake}/jobs/templates` — job template `jobType` 
(and related job DTOs that use status/type enums)
   
   `policyType` is a **string** (plus content polymorphism), not a Jackson 
enum, so it does not get that mapper feature for free. #14520 made 
create/update accept known built-in ids case-insensitively and persist/return 
the canonical lowercase value—the same user-facing rule as the enum APIs above. 
That direction was discussed with @mchads.
   
   So `SYSTEM_ICEBERG_COMPACTION` → HTTP 200 with `policyType: 
system_iceberg_compaction` is consistent with project REST practice; truly 
unknown types such as `system_iceberg_bogus` still return 400 naming the type. 
Please adjust the OSS check for mis-cased known types accordingly.


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