michalkawiak / gwtprojsonserializer

Automatically exported from code.google.com/p/gwtprojsonserializer
0 stars 0 forks source link

Make the JSON object's class attribute optional/configurable #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. serialize or de-serialize any JSON
2.
3.

What is the expected output? What do you see instead?
When I de-serialize a Java object, I get a extra JSON object 
"class":"package.Class". I proved this is not useful in my case. I modified the 
library to not include it, and I was able to serialize and de-serialize without 
any problem.

What version of the product are you using? On what operating system?
1.0.0 with GWT2.0.3 on XP

Please provide any additional information below.
Took keep the size of the JSON string as small as possible, we can either 
remove this object or make it configurable.

Original issue reported on code.google.com by matthias.buchner on 26 Aug 2010 at 3:55

GoogleCodeExporter commented 9 years ago
Removing it is definitely NOT an option, else we cannot for example have 
inheritance.

Making it optional can be an idea.

Original comment by goo...@alishomepage.com on 17 Oct 2010 at 5:36

GoogleCodeExporter commented 9 years ago

Original comment by remi.barraquand on 17 Oct 2010 at 5:37

GoogleCodeExporter commented 9 years ago
It would be really nice, if it was configurable. It's not good from security 
point of view, when you expose implementation details outside.

Original comment by a.kok...@gmail.com on 22 Feb 2011 at 7:02

GoogleCodeExporter commented 9 years ago
If you would like to render it configurable, which can be justified for many 
reaons, any patch will be more than welcome.

Original comment by goo...@alishomepage.com on 27 Feb 2011 at 3:53

GoogleCodeExporter commented 9 years ago
Issue 22 has been merged into this issue.

Original comment by goo...@alishomepage.com on 2 Jun 2011 at 8:49

GoogleCodeExporter commented 9 years ago
Merged issue 22 (Field "class" is not recognized by jackson while 
[de]serializing) into this one.

Any patches are welcome.

Original comment by goo...@alishomepage.com on 2 Jun 2011 at 8:51

GoogleCodeExporter commented 9 years ago
I made a patch for this issue.
It introduces a second module xml file, including a generator which ignores the 
class field. 
To use it, simple add
<inherits 
name='com.kfuntak.gwt.json.serialization.GWTProJsonSerializerNonFlex'/>
instead of
<inherits name='com.kfuntak.gwt.json.serialization.GWTProJsonSerializer'/>

Original comment by andreash...@googlemail.com on 31 May 2012 at 9:41

Attachments: