ryantenney / passkit4j

Java library for generating Apple Passbook (.pkpass) files

Home Page:http://www.ryantenney.com/passkit4j/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@Include.NON_DEFAULT doesn't work in newer versions of Jackson

NodeAdam opened this issue · comments

commented

We are running a later Jackson version on our application server and this is causing this library to be unusable due to this bug.

In the case of Location.altitude (which is optional), not setting a value results in the field not being ignored as it appears in the pass.json file:

{
"latitude" : 37.33182,
"longitude" : -122.03118,
"altitude" : "NaN"
}

This is not a valid format which results in the Wallet app not reading the pass.

I changed Include.NON_DEFAULT to Include.NON_NULL and set the default
altitude value to null. This results in the same behavior as before
the upgrade of Jackson.

I've created a pull request with a fix:
#43