Opened 15 years ago
Closed 9 years ago
#15091 closed New feature (fixed)
Ease using a custom JSON encoder with serialize()
| Reported by: | knurpsburps | Owned by: | Berker Peksag |
|---|---|---|---|
| Component: | Core (Serialization) | Version: | 1.2 |
| Severity: | Normal | Keywords: | |
| Cc: | jschrewe@…, kmike84@…, berker.peksag@… | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I'm trying to use a custom json encoder and the docs tell me how to write one. Sdly they are missing any clue on how to use this encoder. At least I haven't found anything in the docs.
Change History (10)
follow-up: 2 comment:1 by , 15 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 15 years ago
| Cc: | added |
|---|
Replying to gabrielhurley:
I'm guessing this is in reference to the serialization topic guide (particularly the last few paragraphs of the JSON section).
Yes.
I'll agree there probably should be a section in the topic guide on installing/using your own serializer. Relevant information in the source code and in the settings reference.
So, from what I read from these links is that in order to use a different encoder a new serializer must be used? The documentation in that section seemed to imply that encoders could be changed without that. But maybe that's just hope on my part.
But anyway, I think at least a hint in the docs would make this a lot clearer.
comment:3 by , 15 years ago
| Cc: | added; removed |
|---|
comment:4 by , 15 years ago
| Cc: | added |
|---|
comment:5 by , 15 years ago
| Severity: | → Normal |
|---|---|
| Type: | → Bug |
comment:8 by , 9 years ago
| Cc: | added |
|---|---|
| Has patch: | set |
| Owner: | changed from to |
| Status: | new → assigned |
Indeed it is impossible to pass a custom encoder without subclassing the JSON serializer. I made cls customizable in my PR.
comment:9 by , 9 years ago
| Component: | Documentation → Core (Serialization) |
|---|---|
| Summary: | Serializer docs contain nothing on how to use a custom encoder → Ease using a custom JSON encoder with serialize() |
| Triage Stage: | Accepted → Ready for checkin |
| Type: | Bug → New feature |
I'm guessing this is in reference to the serialization topic guide (particularly the last few paragraphs of the JSON section).
I'll agree there probably should be a section in the topic guide on installing/using your own serializer. Relevant information in the source code and in the settings reference.