jdereg / json-io

Convert Java to JSON. Convert JSON to Java. Pretty print JSON. Java JSON serializer. Deep copy Java object graphs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why?

caffeine-mgn opened this issue · comments

commented

Version 4.12
Class com.cedarsoftware.util.io.ObjectResolver
Method: assignField
Line: 222

                else if (rhs instanceof String && "".equals(((String) rhs).trim()) && fieldType != String.class)
                {   // Allow "" to null out a non-String field
                    field.set(target, null);
                }
commented

I have some common result object like

data class Response(val result: Any? = null, val exception: Boolean = false)

And when my service returns empty string I got null