-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom JSON encoder/decoder #30
Comments
Unfortunately using custom JSON serializer is not possible in current Adding We are already accept these params in I suggest moving The patch is very easy. Any volunteers? |
As workaround I suggest converting The change deserves a new aiohttp_session release. |
I am happy and look forward to becoming one comtributor. i think that "moving self._encoder and self._decoder to AbstractStorage constructor" is a good way. |
@TechBK you should create a Pull Request |
😃 ok |
@asvetlov hey, my friend. check Pull Request. |
I just came across this relatively old issue. Unless I'm missing something, is there a reason why @TechBK's change was never merged? If there is a reason I suggest closing this issue otherwise I'd get a PR ready soon. (Especially since his fork looks like he basically completed it) |
Sorry, but I cannot find any related PR. |
I think @BFriedrichs refers to #31 . |
Looks like @TechBK gave up after first review tour. |
Correct, I missed that for some reason. I haven’t really looked into how much changed since then but I can’t imagine these changes wouldn’t be still applicable. |
I suggest creating a new PR from scratch and discussing it. |
Are there any updates on this issue? |
The workaround to this issue is by defining a custom JSONEncoder to json_serialize argument in ClientSession like below: class BaseClient:
async def get_client_session(self):
return aiohttp.ClientSession(base_url=client_config.CLIENT_TRANSACTION_URL,
json_serialize=lambda object: json.dumps(
object,
indent=4,
sort_keys=True,
default=str)
) |
Appears there is still no finished PR, feel free to propose one. |
When i try do
with user is a document of mongo, my program occur a error:
How do i replace 'json' encoder with 'bson.json_until' encoder?
https://github.com/aio-libs/aiohttp_session/blob/master/aiohttp_session/cookie_storage.py#L51
The text was updated successfully, but these errors were encountered: