JSON serialization using injection and mixins