You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by fe...@apache.org on 2023/01/29 06:29:26 UTC

[kyuubi] branch master updated: [KYUUBI #4119][FOLLOWUP] Do not fail on unknown properties to keep kyuubi-ctl compatiblity

This is an automated email from the ASF dual-hosted git repository.

feiwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 750eb6ab5 [KYUUBI #4119][FOLLOWUP] Do not fail on unknown properties to keep kyuubi-ctl compatiblity
750eb6ab5 is described below

commit 750eb6ab5d9d01d849c83d8a0d3c9820051c7ad3
Author: fwang12 <fw...@ebay.com>
AuthorDate: Sun Jan 29 14:29:17 2023 +0800

    [KYUUBI #4119][FOLLOWUP] Do not fail on unknown properties to keep kyuubi-ctl compatiblity
    
    ### _Why are the changes needed?_
    
    ```
    Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "appStartTime" (class org.apache.kyuubi.client.api.v1.dto.Batch), not marked as ignorable (13 known properties: "appDiagnostic", "createTime", "kyuubiInstance", "user", "appUrl", "appState", "state", "batchType", "cluster", "id", "appId", "endTime", "name"])
    ```
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #4208 from turboFei/ignore_unknown.
    
    Closes #4119
    
    0e81ac7ae [fwang12] save
    
    Authored-by: fwang12 <fw...@ebay.com>
    Signed-off-by: fwang12 <fw...@ebay.com>
---
 .../src/main/java/org/apache/kyuubi/client/util/JsonUtils.java        | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/util/JsonUtils.java b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/util/JsonUtils.java
index f42849166..855a15280 100644
--- a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/util/JsonUtils.java
+++ b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/util/JsonUtils.java
@@ -17,12 +17,14 @@
 
 package org.apache.kyuubi.client.util;
 
+import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.kyuubi.client.exception.KyuubiRestException;
 
 public final class JsonUtils {
 
-  private static final ObjectMapper MAPPER = new ObjectMapper();
+  private static final ObjectMapper MAPPER =
+      new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
 
   public static String toJson(Object object) {
     try {