Re: AutoBeanCodexEncode does not encode numbers when zero is the value

2016-09-21 Thread Yann Vo
For what it's worth, more than 3 years later... one workaround to have zero values serialized (along with the key) as you ask for is to use an Integer rather than an int. This is the JavaScript semantic (anything can be undefined or null) and then it behaves as other JSON serializers to omit nul

Re: AutoBeanCodexEncode does not encode numbers when zero is the value

2013-07-19 Thread Jens
I would say its an AutoBean Framework optimization and it is working as intended. The framework assumes that you use AutoBeanCodex.decode() to parse the payload, which will probably set all AutoBean properties to default values and then update the ones found in the payload. There is no need to

Re: AutoBeanCodexEncode does not encode numbers when zero is the value

2013-07-19 Thread Jens
I can see your point, maybe you just create an issue asking for a flag that causes default values to be included in the payload so that AutoBeans can better be used with existing REST services. Wouldn't hurt and would make AutoBeans even more attractive. -- J. -- You received this message bec

Re: AutoBeanCodexEncode does not encode numbers when zero is the value

2013-07-19 Thread Pedro LamarĂ£o
Em sexta-feira, 19 de julho de 2013 16h33min26s UTC-3, AJ escreveu: > > The AutoBean > pagestates > Goals > >- Decrease boilerplate in model-rich applications >- Support easy encoding of AutoBeans to JSON structures >- P

Re: AutoBeanCodexEncode does not encode numbers when zero is the value

2013-07-19 Thread AJ
The AutoBean pagestates Goals - Decrease boilerplate in model-rich applications - Support easy encoding of AutoBeans to JSON structures - Provide support code for common operations on data-model objects - *Usable in non-GW

Re: AutoBeanCodexEncode does not encode numbers when zero is the value

2013-07-19 Thread Anthony Elcocks
That restricts me to destinations that are within my control and are Java based. Say I want to send some data to a restful server based on node.js, fo example. The AutoBeans are very useful because they allow me to create beans without the need to code my own toJson() method on each object. I under

AutoBeanCodexEncode does not encode numbers when zero is the value

2013-07-19 Thread AJ
com.google.web.bindery.autobean.shared.impl.AutoBeanCodexImpl @Override public boolean visitValueProperty(String propertyName, Object value, PropertyContext ctx) { if (value != null && !value.equals(ValueCodex.getUninitializedFieldValue(ctx.getType( { encodeProperty(pro