Opened 13 years ago

Closed 8 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)

comment:1 by Gabriel Hurley, 13 years ago

Triage Stage: UnreviewedAccepted

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.

in reply to:  1 comment:2 by knurpsburps, 13 years ago

Cc: jschrewe@… 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 knurpsburps, 13 years ago

Cc: jschrewe@… added; jschrewe@… removed

comment:4 by Mikhail Korobov, 13 years ago

Cc: kmike84@… added

comment:5 by James Addison, 13 years ago

Severity: Normal
Type: Bug

comment:6 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:7 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:8 by Berker Peksag, 8 years ago

Cc: berker.peksag@… added
Has patch: set
Owner: changed from nobody to Berker Peksag
Status: newassigned

Indeed it is impossible to pass a custom encoder without subclassing the JSON serializer. I made cls customizable in my PR.

comment:9 by Tim Graham, 8 years ago

Component: DocumentationCore (Serialization)
Summary: Serializer docs contain nothing on how to use a custom encoderEase using a custom JSON encoder with serialize()
Triage Stage: AcceptedReady for checkin
Type: BugNew feature

comment:10 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In c1b6f554:

Fixed #15091 -- Allowed passing custom encoder to JSON serializer.

Note: See TracTickets for help on using tickets.
Back to Top