Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deserialize does not work expected when @type is not the first element. #18

Closed
bingoohuang opened this issue Dec 26, 2012 · 2 comments
Closed

Comments

@bingoohuang
Copy link

I have a class with two properties: firstName and lastName (will full getters and setters).

JSON.parse("{"firstName":"first","@type":"demo.JsonTest$JSONDemo","lastName":"last"}");

will ignore firstName left it null value.

Is this a bug or designed?

@wenshao
Copy link
Member

wenshao commented Dec 26, 2012

this is designed feature, not a bug. why you require "@type" is not the first element?

@bingoohuang
Copy link
Author

We developed a web app in which depends on your fastjson. But the client program guys use c++. we said @type is needed with some value, so they append @type as the last element of json string. And as a result, the server did response fail. So we checked it and found that @type should be the first element.
It is OK now to move @type to the first.
Tks.

wenshao pushed a commit that referenced this issue Aug 8, 2016
wenshao pushed a commit that referenced this issue Feb 12, 2018
asa1997 pushed a commit to Be-Secure/fastjson that referenced this issue Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants