@Override
        public void serialize(ThriftReply value, JsonGenerator gen, SerializerProvider provider)
                throws IOException {
            if (value == null) {
                // Oneway function doesn't provide reply
                gen.writeNull();
                return;
            }

            gen.writeStartObject();
            gen.writeFieldName("header");
            serializeTMessage(value.header(), gen);

            final TBase<?, ?> result;
            final TApplicationException exception;
            if (value.isException()) {
                result = null;
                exception = value.exception();
            } else {
                result = value.result();
                exception = null;
            }

            gen.writeFieldName("result");
            serializeTBase(result, gen, useNamedEnums);
            gen.writeFieldName("exception");
            serializeTApplicationException(exception, gen, useNamedEnums);
            gen.writeEndObject();
        }
Jackson {@link JsonSerializer} for {@link ThriftReply}.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/common/thrift/ThriftJacksonSerializers.java