-
Notifications
You must be signed in to change notification settings - Fork 76
DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT doesn't work #112
Comments
I assume what you get here is an exception for last case? |
An AssertionError, because the value of testString is "", no matter if |
Ok, I don't think that is an error, then. However; for CSV handling specifically it would be possible to add separate |
Actually: come to think of this, there is already a mechanism for this: when constructing |
Right, this works. Thanks! |
I'm already using |
@robmoore I am hesitant to add support for a larger set of transformations. But if it'd be enough to just support empty String and one alternative notation (like "null"), I think that this combination should work (or be made to work if not yet) -- coercion of "" to But I think you may want to file a separate issue for your specific use case, partly since this issue is closed, and partly since your usage/expectation may be slightly different. |
@cowtowncoder The solution you propose would work fine for this use case. I'll open a separate ticket. |
Empty Strings are not deserialized into null objects, even if
ACCEPT_EMPTY_STRING_AS_NULL_OBJECT
is enabled. Sample code is here:ObjectReader:
Object:
CSV file (first row is the header, second row is the data):
Test case:
The text was updated successfully, but these errors were encountered: