python-react
python-react copied to clipboard
Allow JSON serializer to be overridden
It's probably worth allowing custom json serializers to be easily added.
The change should be pretty simple, see
https://github.com/markfinger/python-react/blob/1bad117ab36ced678b3c99b876b5e3eb7baa0750/react/render_server.py#L27
Basically, RenderServer.render should accept a json_encoder kwarg, that defaults to the current one.
It's also probably worth explicitly exposing the default encoder as a RenderServerEncoder subclass, to make subclassing easier for downstream users.
See also: #77