stepio / jpasskit

jPasskit is an Java™ implementation of the Apple™ PassKit Web Service.
Apache License 2.0
0 stars 0 forks source link

Improve API to support reusing the same ObjectMapper #13

Closed stepio closed 8 years ago

stepio commented 8 years ago

Now there is only one constructor available - with ObjectMapper. But actually you cannot pass existing immutable instance, as additional configurations are applied in constructor:

        jsonObjectMapper.setSerializationInclusion(Include.NON_NULL);
        jsonObjectMapper.addMixIn(Object.class, ValidateFilterMixIn.class);
        jsonObjectMapper.addMixIn(PKPass.class, PkPassFilterMixIn.class);
        jsonObjectMapper.addMixIn(PKBarcode.class, BarcodeFilterMixIn.class);
        jsonObjectMapper.addMixIn(Charset.class, CharsetFilterMixIn.class);

So if you'd like to use the existing object mapper (as API owner suggests), it's state is altered, which is not very good.