jerryshao commented on code in PR #13057:
URL: https://github.com/apache/gravitino/pull/13057#discussion_r3975385051
##########
server-common/src/main/java/org/apache/gravitino/server/web/ObjectMapperProvider.java:
##########
@@ -28,16 +29,22 @@
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
+import org.apache.gravitino.dto.responses.ErrorResponse;
@Provider
public class ObjectMapperProvider implements ContextResolver<ObjectMapper> {
+ // Keep diagnostic stacks inside the server and accept legacy payloads, but
never publish them.
+ @JsonIgnoreProperties(value = "stack", allowSetters = true)
+ private abstract static class ErrorResponseMixin {}
+
private static class ObjectMapperHolder {
private static final ObjectMapper INSTANCE =
JsonMapper.builder()
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
.configure(EnumFeature.WRITE_ENUMS_TO_LOWERCASE, true)
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS)
+ .addMixIn(ErrorResponse.class, ErrorResponseMixin.class)
Review Comment:
Does it mean that the stack will always be ignored in the error response?
I read the issue; I think the original meaning is that we can have a
configuration to control this behavior. I think we should have such a
configuration for different scenarios.
--
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]