This library supports Smaato OpenRTB (JSON) extensions for Google OpenRTB (protobuf). It has implementation for serialization and deserialization of Smaato latest bid request extensions (JSON). You can find the extensions on Smaato's DSP Integration site Resources. It makes the Integration with Smaato ad-exchange more easier for any DSP.
First, the JSON factory should be created using OpenRtbJsonFactory class of Google OpenRTB:
OpenRtbJsonFactory jsonFactory = OpenRtbJsonFactory.create();
Then register all Smaato extensions (ImpExt and BidRequestExt):
SmaatoExtUtils.registerSmaatoExt(jsonFactory);
To deserialize a bid request from input stream for example:
BidRequest bidRequest = jsonFactory.newReader()
.readBidRequest(inputStream)
Boolean strictbannersize = bidRequest.getImp(0)
.getExtension(SmaatoExt.imp)
.getStrictbannersize();
String androidid = bidRequest.getExtension(SmaatoExt.bidRequest)
.getUdi()
.getAndroidid();
To serialize a bid response to JSON string for example:
String jsonResponse = jsonFactory.newWriter().writeBidResponse(bidResponse);
The library has not yet been hosted on any Maven public repository. It should be build and provided by Maven local repository. Also, the tests has not yet been implemented.