krvikash commented on code in PR #6512:
URL: https://github.com/apache/iceberg/pull/6512#discussion_r1235919848
##########
core/src/main/java/org/apache/iceberg/rest/RESTSerializers.java:
##########
@@ -91,8 +94,12 @@ public static void registerAll(ObjectMapper mapper) {
.addDeserializer(
ImmutableReportMetricsRequest.class, new
ReportMetricsRequestDeserializer<>())
.addSerializer(CommitTransactionRequest.class, new
CommitTransactionRequestSerializer())
+ .addDeserializer(CommitTransactionRequest.class, new
CommitTransactionRequestDeserializer())
+ .addSerializer(RegisterTableRequest.class, new
RegisterTableRequestSerializer<>())
+ .addDeserializer(RegisterTableRequest.class, new
RegisterTableRequestDeserializer<>())
Review Comment:
Removing any one of them throws the below response. I see
`ReportMetricsRequest` register both the interface and the implementation.
```
org.apache.iceberg.exceptions.ServiceFailureException: Server error:
null: {
"servlet":"org.apache.iceberg.rest.RESTCatalogServlet-4c38cd16",
"cause0":"com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot
construct instance of `org.apache.iceberg.rest.requests.RegisterTableRequest`
(no Creators, like default constructor, exist): abstract types either need to
be mapped to concrete types, have custom deserializer, or contain additional
type information\n at [Source: (org.eclipse.jetty.server.Request$1); line: 1,
column: 1]",
"message":"com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
Cannot construct instance of
`org.apache.iceberg.rest.requests.RegisterTableRequest` (no Creators, like
default constructor, exist): abstract types either need to be mapped to
concrete types, have custom deserializer, or contain additional type
information\n at [Source: (org.eclipse.jetty.server.Request$1); line: 1,
column: 1]",
"url":"/v1/namespaces/newdb/register",
"status":"500"
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]