Closed Bug 486074 Opened 15 years ago Closed 14 years ago

Objects not serialized properly under JSON WebServices (Bug.get's "internals" object)

Categories

(Bugzilla :: WebService, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: mkanat, Assigned: mkanat)

Details

Attachments

(1 file)

For some reason, our JSON WebServices interface is not properly converting objects into hashes, even though we have specified that it should. It's just sending undef for objects, instead. This may be a bug in JSON::RPC.
Version: 3.3.3 → 3.5
Flags: blocking3.6+
Attached patch v1Splinter Review
Turns out the JSON.pm docs say that we do indeed need to specify our own TO_JSON method. Thankfully, this was really easy.

In the future, I think we might want to modify this to only return "name" and "id", and then we could start putting objects directly into our return values.
Assignee: webservice → mkanat
Status: NEW → ASSIGNED
Attachment #427688 - Flags: review?(dkl)
Attachment #427688 - Flags: review?(dkl) → review+
Comment on attachment 427688 [details] [diff] [review]
v1

Agreed that we should eventually be more careful in what we return but works well for now. r=dkl
Flags: approval3.6+
Flags: approval+
Cool, thanks. :-)

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/                       
modified Bugzilla/Object.pm
Committed revision 7023.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/3.6/                         
modified Bugzilla/Object.pm
Committed revision 6997.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: