Marshaling objects to JSON shows internal properties

Description

When marshaling an object with renderdata in the json format, the $mixin property is part of the structure

event.renderData(data=object, format='json');

Activity

Show:
Luis Majano
September 21, 2016, 9:03 PM

The issue with this is that there is no way for us to know which properties we should or should not marshall. The best approach would be to have a memento representation in the object and send that to render instead of the object itself. Thoughts?

Brad Wood
September 21, 2016, 9:38 PM

I would disagree that it's impossible to know what properties shouldn't be part of the object. WireBox added those properties, so there's no reason why it can't be documented the list of special properties WireBox is going to add. It is, after all, our own code doing this so it's not like it's a black box. In fact, we can probably even get a list of injected keys dynamically from the mixer util at run time. Have the marshaller automatically exclude any keys that WireBox reports as being part of it's building process.

Won't Fix

Assignee

Luis Majano

Reporter

Pascal Peters

Labels

None

Components

Affects versions

Priority

Minor
Configure