lasdf1234 commented on PR #14520:
URL: https://github.com/apache/gravitino/pull/14520#issuecomment-6604397357

   @mchades Thanks, reworked along your suggestion:
   
   - Known `policyType` values (all built-ins and `custom`) are resolved 
case-insensitively by a small `PolicyContentTypeIdResolver`, scoped to the 
policy content fields, before content is bound. `SYSTEM_ICEBERG_COMPACTION` 
selects compaction content and is validated as such. `custom` is registered 
explicitly, and there is no fallback to custom content.
   - Removed both whole-request deserializers. Create and update use Jackson's 
default field binding again.
   - An unresolved type binds content as `null` (`defaultImpl = Void.class`). 
`validate()` resolves the type first, so the existing policy exception handler 
returns a type-named 400 such as `Unknown built-in policy type: 
system_iceberg_bogus`. `JsonMappingExceptionMapper` is unchanged from main and 
does not expose `IllegalArgumentException` causes.
   - Create stores `BuiltInType.policyType()`, and `updateContent` now also 
passes the canonical lowercase value.
   - Tests cover lowercase, uppercase and mixed-case known types on create and 
update (DTO and REST), unknown types with empty and non-empty content, and the 
existing field validation. The case-insensitive input and lowercase output are 
documented in `manage-policies-in-gravitino.md` and in the `policyType` 
descriptions in `policies.yaml`.


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