I can't find any place it looks like this is able to be accomplished so I'll give some examples and possible solutions just in case it is not already solved for. If it has please let me know.
Assuming I have this complex type:
class Container(types.Base):
name = types.text
when WSME serializes to json it produces:
what I would like is for WSME to serialize to:
{"container": {"name": null}}
Where "container" could be derived from either the class name or some overrideable attribute in the class like:
class Container(types.Base):
_json_root = 'container'
name = types.text
This should also result in the json root tag not being rendered when these complex types are in a list, but a plural version should be added as the root tag of the list. Example:
{"containers": [{"name": null}]}
NOT this (or it can be customized)
{"containers": [{"container": {"name": null}}]
This of course means there should be a plural version of the json root defined because adding an 's' doesn't always work:
class Container(types.Base):
_json_root = 'container'
_json_root_list = 'containers'
name = types.text