By default, stack traces are not serialized to avoid leaking implementation details. To enable them (e.g., for debugging in integration environments), register the ProblemModule with .withStackTraces() in your JsonMapper.
Warning: Stack traces are not deserializable from JSON by design. To fix the fact that deserialized stack traces often point to the deserialization framework rather than the source, implement the StackTraceProcessor interface and register it via ServiceLoader.
// Enable stack trace serialization
JsonMapper mapper = JsonMapper.builder()
.addModule(new ProblemModule().withStackTraces())
.build();
// Customizing stack traces via SPI
public interface StackTraceProcessor {
Collection<StackTraceElement> process(final Collection<StackTraceElement> elements);
}