Closed YoavNordmann closed 7 years ago
Hi I see a lot of documentation on how to add an extension using the proto files and then adding and using that extension. I see no documentation which has an example including json serialization. If you would help me I would be happy to write a blog explaining said example from beginning to end. Yoav
Hi
I am desperately trying to configure the JSON Serialization/deserialization for an extension I wrote such as this:
`message BidResponseErrors {
}`
I am able to Add data to the extension and I can see it using the debugger. But I cannot figure out how to write the BidResponseErrorsWriter and the BidResponseErrorsReader, how to initialize them and what to write inside.
I am lacking a lot of documentation. So far this is what I have:
The writer:
public class BidResponseErrorsWriter extends OpenRtbJsonExtWriter<BidResponseErrors> { @Override protected void write(BidResponseErrors value, JsonGenerator gen) throws IOException { gen.writeStartArray(); gen.writeEndArray(); } }
The Reader:public class BidResponseErrorsReader extends OpenRtbJsonExtReader<BidResponseErrors.Builder>{ protected void read(Builder msg, JsonParser par) throws IOException { } }
And the registration:
OpenRtbJsonWriter jsonWriter = OpenRtbJsonFactory.create() .register(new BidResponseErrorsWriter(), BidResponseErrors.class, BidResponse.class) .newWriter();
Needless to say that nothing here works, and the writer method is not invoked. Any help would be very much appreciated.
Thank You
Yoav