framework
framework copied to clipboard
Conversion from XML produces invalid JSON
When converting a flat array from xml, when combined with other elements, the resulting JSON is invalid. for example, when converting a piece of xml that looks like this: <f>1</f> <f>2</f> <f>3</f> , the result is correct : "f" : [1,2,3], however, if we add another node:
<f>1</f> <f>2</f> <f>3</f> <z>foo</z>, the result is something like this: { "f": "1", "f": "2", "f": "3", "z":"foo" }. I believe this is happening because of the array_? definition is checking distinct = 1 for fields of surrounding element. Also, a simple solution would be to first group by the name of the node and then do the array check for each group where an array is the map's value where count > 1. that would not drop elements and produce "correct" JSON.
Thanks.
Please on the list before opening tickets. See http://liftweb.net/community for more.
I am not sure what I need to do. Is this already documented somewhere?
On Thu, Aug 9, 2012 at 11:08 AM, Antonio Salazar Cardozo < [email protected]> wrote:
Please on the list before opening tickets. See http://liftweb.net/community for more.
— Reply to this email directly or view it on GitHubhttps://github.com/lift/framework/issues/1305#issuecomment-7616677.
You need to discuss the issue on the Lift mailing list before opening tickets.
Why? Because there may have been design decisions related to the particular behavior and discussing them in one place (on the Lift mailing list) makes it easier for the community as a whole to understand and for people to find information about the issue before opening a subsequent ticket on the same issue... so please start a discussion on the Lift mailing list about this issue and Joni (the lift-json owner) will gladly discuss it with you.
Thanks,
David
gotcha, no problem, after i sent the email, i saw the rules on the board, sorry, i am new to the community. i've posted to the forums.
thanks, alex
On Thu, Aug 9, 2012 at 1:48 PM, David Pollak [email protected]:
You need to discuss the issue on the Lift mailing list before opening tickets.
Why? Because there may have been design decisions related to the particular behavior and discussing them in one place (on the Lift mailing list) makes it easier for the community as a whole to understand and for people to find information about the issue before opening a subsequent ticket on the same issue... so please start a discussion on the Lift mailing list about this issue and Joni (the lift-json owner) will gladly discuss it with you.
Thanks,
David
— Reply to this email directly or view it on GitHubhttps://github.com/lift/framework/issues/1305#issuecomment-7621359.
We need some kind of hook that forwards tickets to the mailing list automatically. :)
On Thu, Aug 9, 2012 at 1:48 PM, David Pollak [email protected]:
You need to discuss the issue on the Lift mailing list before opening tickets.
Why? Because there may have been design decisions related to the particular behavior and discussing them in one place (on the Lift mailing list) makes it easier for the community as a whole to understand and for people to find information about the issue before opening a subsequent ticket on the same issue... so please start a discussion on the Lift mailing list about this issue and Joni (the lift-json owner) will gladly discuss it with you.
Thanks,
David
— Reply to this email directly or view it on GitHubhttps://github.com/lift/framework/issues/1305#issuecomment-7621359.
ML post is at https://groups.google.com/d/msg/liftweb/4inKYuPFMgw/3d4ZEb2OMXwJ .