sgzwiz / jsonplugin

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

Exclude Null Properties. #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Guys...

I'm using an Chart API that uses Json serialized objects to create the
charts. I would like to create a generic javabeans strutcture based on the
API's definition.

But I'm having a problem.

If I pass null to some attributes, the API doesn't generate the graph. But
it's obligatory to define it.

Then, I was wondering if is possible to create a config-param defining if
the plugin should serialize null attibutes or not.

Something like this:

<result type="json">
  <param name="excludeNullAttributes">true</param>
</result>

If this param is null, an object like
{"attr1":"value 1", "attr2":null}
will never be created. 

It would be
{"attr1":"value 1"} , instead.

Regards!
Filipi Zimermann

Original issue reported on code.google.com by fili...@gmail.com on 17 Oct 2008 at 9:28

GoogleCodeExporter commented 9 years ago
excludeNullProperties added (false by default)

Original comment by musa...@gmail.com on 21 Oct 2008 at 3:25