rdblue commented on a change in pull request #4266:
URL: https://github.com/apache/iceberg/pull/4266#discussion_r830679161



##########
File path: 
core/src/main/java/org/apache/iceberg/rest/requests/CreateNamespaceRequest.java
##########
@@ -19,81 +19,42 @@
 
 package org.apache.iceberg.rest.requests;
 
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import java.util.Map;
-import java.util.Objects;
 import org.apache.iceberg.catalog.Namespace;
 import org.apache.iceberg.relocated.com.google.common.base.MoreObjects;
-import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
-import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
-import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.immutables.value.Value;
 
 /**
  * A REST request to create a namespace, with an optional set of properties.
+ *
+ * Note that Immutable classes by definition don't have a default no-arg 
constructor (which is required for Jackson),
+ * therefore the @{@link JsonSerialize}/@{@link JsonDeserialize} annotations 
on the class will generate what's
+ * necessary for Jackson-binding to properly work with this class.

Review comment:
       Ah, we don't want to use Jackson annotations.
   
   [Annotations aren't required to be 
present](https://stackoverflow.com/questions/3567413/why-doesnt-a-missing-annotation-cause-a-classnotfoundexception-at-runtime),
 so they don't work well in libraries. Relying on annotations that may not be 
there adds a significant source of bugs: the runtime classpath. That's already 
one of the hardest places to track down issues.
   
   By not using annotations and instead relying on the basic behavior, we can 
eliminate classpath issues causing serialization problems. I think that's well 
worth having some builder code that doesn't change much.




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

Reply via email to