Conversion from XML produces invalid JSON #1305

Open
shveik opened this Issue Aug 9, 2012 · 6 comments

Comments

Projects
None yet
5 participants

shveik commented Aug 9, 2012

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.

Owner

Shadowfiend commented Aug 9, 2012

Please on the list before opening tickets. See http://liftweb.net/community for more.

Shadowfiend closed this Aug 9, 2012

shveik commented Aug 9, 2012

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 <
notifications@github.com> 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.

Owner

dpp commented Aug 9, 2012

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

shveik commented Aug 9, 2012

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 notifications@github.comwrote:

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.

Contributor

nafg commented Aug 10, 2012

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 notifications@github.comwrote:

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.

jonifreeman reopened this Aug 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment