I have been using ColdBox for quite some time now, since Version 2.6. Recently, I have been doing a lot of work with RESTful services. All seems well, except for one minor frustration reported by clients regarding the way that the renderData as XML works.
If I pass an object into the renderData event method, which includes a structure, the XML tree wraps the structure keys in elements. This seems to be unnecessary as a structure is simply a list of key/value pairs. Is there any way to modify this behavior, other than modifying the toXML method?
Nevermind on this. I should have searched for this issue first. I found a reference to this issue at here, which basically explains that I would need to override the event.renderData() with a custom requestContextDecorator.
I’ll run down that road and see how that works out.
My expectation would be that a struct named, say, “Person”, with three elements of “Firstname”, “Lastname”, and “Phone” would be listed as:
Luis
Majano
not:
Luis
Majano
The later seems unnecessary to me since a struct is simply key/values. Understandably, you could have complex data types as a struct element, and those would need to be expanded and iterated through. It isn’t a huge deal, just seems like an extra node that has to be parsed by the client.
My expectation would be that a struct named, say, “Person”, with three elements of “Firstname”, “Lastname”, and “Phone” would be listed as:
Luis
Majano
not:
Luis
Majano
The later seems unnecessary to me since a struct is simply key/values. Understandably, you could have complex data types as a struct element, and those would need to be expanded and iterated through. It isn’t a huge deal, just seems like an extra node that has to be parsed by the client.
My expectation would be that a struct named, say, “Person”, with three elements of “Firstname”, “Lastname”, and “Phone” would be listed as:
Luis
Majano
not:
Luis
Majano
The later seems unnecessary to me since a struct is simply key/values. Understandably, you could have complex data types as a struct element, and those would need to be expanded and iterated through. It isn’t a huge deal, just seems like an extra node that has to be parsed by the client.
Let me think on this on a bit. I’ll run some tests. At this point, with my usage thus far, I haven’t seen anything that necessitates the node. It just seems extraneous, but I’ll validate that and send some sample as soon as I get a bit of time.
Thanks for looking at this and I’ll get more info to you.