From fa60e4c70be38bd87fefe50558277fa90a632c1e Mon Sep 17 00:00:00 2001 From: fwang12 Date: Wed, 12 Apr 2023 15:25:08 +0800 Subject: [PATCH] [KYUUBI #4691] [REST] Configure FAIL_ON_UNKNOWN_PROPERTIES to false for KyuubiScalaObjectMapper ### _Why are the changes needed?_ Do not failed on unknown properties in server side. ### _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 #4691 from turboFei/ignore. Closes #4691 a03cb5be0 [fwang12] Ignore c406878e7 [fwang12] Fast return batch info when post batches Authored-by: fwang12 Signed-off-by: fwang12 --- .../apache/kyuubi/server/api/KyuubiScalaObjectMapper.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/KyuubiScalaObjectMapper.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/KyuubiScalaObjectMapper.scala index 776c35ba7..724da1209 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/KyuubiScalaObjectMapper.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/KyuubiScalaObjectMapper.scala @@ -19,11 +19,13 @@ package org.apache.kyuubi.server.api import javax.ws.rs.ext.ContextResolver -import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.{DeserializationFeature, ObjectMapper} import com.fasterxml.jackson.module.scala.DefaultScalaModule class KyuubiScalaObjectMapper extends ContextResolver[ObjectMapper] { - private val mapper = new ObjectMapper().registerModule(DefaultScalaModule) + private val mapper = new ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .registerModule(DefaultScalaModule) override def getContext(aClass: Class[_]): ObjectMapper = mapper }