'type' property should be whitelisted in toJSON call