kameshsampath commented on issue #996:
URL: https://github.com/apache/polaris/issues/996#issuecomment-2665531350

   @cgpoh  @MonkeyCanCode @flyrain  @sfc-gh-ygu  how does this change look  ?
   ```java
     public static final class CreateCatalogRequestDeserializer
         extends JsonDeserializer<CreateCatalogRequest> {
       @Override
       public CreateCatalogRequest deserialize(JsonParser p, 
DeserializationContext ctxt)
           throws IOException, JacksonException {
         TreeNode treeNode = p.readValueAsTree();
         if (treeNode.isObject() && ((ObjectNode) treeNode).has("catalog")) {
           ObjectNode catalogTreeNode = (ObjectNode) treeNode;
           JsonNode catalogNode = catalogTreeNode.get("catalog");
           if (catalogNode.has("storageConfigInfo")) {
             ObjectNode storageConfigNode = (ObjectNode) 
catalogNode.get("storageConfigInfo");
             if (storageConfigNode.has("storageType")) {
               String storageType = 
storageConfigNode.get("storageType").asText();
               //make sure the storageType are Deserialized to upper case types
               storageConfigNode.put("storageType", storageType.toUpperCase());
             }
           }
           return CreateCatalogRequest.builder()
               .setCatalog(ctxt.readTreeAsValue(catalogNode, Catalog.class))
               .build();
         } else {
           return CreateCatalogRequest.builder()
               .setCatalog(ctxt.readTreeAsValue((JsonNode) treeNode, 
Catalog.class))
               .build();
         }
       }
     }
   ```
   
   If this looks OK, I wonder we need the change to 
`org.apache.polaris.service.admin.PolarisServiceImpl` as storageTypes will now 
always be serialised to UpperCase
   
   


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