Serializer ignoring dynamically added properties #181

Open
wants to merge 1 commit into from

1 participant

@mpj

The serializer was not including properties that was added dynamically to classes.

The reason I really want this is that sometimes, the JSON you want to create does not quite correspond to the object you are serializing. In my case, the web service handling the JSON output needed a property called "in". "in" is a reserved keyword in ActionScript, so in my model, I have named it "inPoint". This means that I need this, pre-serialization:

var obj:myObject = myService.getObject();
obj['in'] = obj.inPoint;
var json:String = JSON.encode(obj);

All good so far, BUT the serializer was not including properties that was added dynamically to classes. This was due to an unnecessarily strict if-clause, which I have now relaxed a bit.

@mpj mpj The serializer was not including properties that was added dynamicall…
…y to classes. This was due to an unnecessarily strict if-clause.
d8c6a5f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment