module.toJSON() doesn't return JSON :)
Closed this issue · 4 comments
georgecrawford commented
Suggest a rename to module.serialize().
wilsonpage commented
This is following backbone convention:
model.toJSON();
matthew-andrews commented
But the output isn't JSON, it's javascript objects - which is even weirder when this API convention is used in other languages - when the output is even less JSON'y...
georgecrawford commented
Incidentally, @matthew-andrews, I feel tempted to implement this as follows in the PHP port:
$module->serialize(); // returns associative array
$module->toJSON(); // returns JSON-encoded serialization
matthew-andrews commented
Even though it is misleading it's consistent with other libs... Maybe it's ok...