moov-io / iso8583

A golang implementation to marshal and unmarshal iso8583 message.
https://moov.io
Apache License 2.0
304 stars 100 forks source link

JSON (un)marshal Bitmap field #245

Closed alovak closed 1 year ago

alovak commented 1 year ago

This PR allows the Bitmap fields to be JSON (un) marshaled.

In #133 we removed the marshaling and unmarshaling of the Bitmap field. I believe if we're using JSON to represent messages, it could also incorporate a bitmap. This would be beneficial for viewing the bitmap's hex representation when marshaling the message into JSON. However, the downside is that unmarshaling doesn't ensure the bitmap's accuracy. For instance, if some fields are removed from the JSON, the remaining fields and bitmap could still be unmarshaled without issue. The problem arises as the bitmap no longer accurately reflects the original set of fields.

Would love to get some feedback about it.