smile-museum / magento2-module-webhook

Webhooks for Magento 2
MIT License
49 stars 15 forks source link

Add consistent serialization #7

Open wcurtis opened 9 years ago

wcurtis commented 9 years ago

Right now serializing the payload of the webhook is super basic, just calling getData() on the model. This is all kinds of bad because it will expose sensitive information like password hashes and such. A better strategy would be to create a serializer for each resource. An even better strategy is if we could re-use the serializer for the REST API so our webhook data has an identical json structure to the API. Boom.

All feedback or recommendations welcome