@@ -1343,8 +1343,13 @@ protected CoercionAction _checkFromStringCoercion(DeserializationContext ctxt, S
1343
1343
LogicalType logicalType , Class <?> rawTargetType )
1344
1344
throws IOException
1345
1345
{
1346
- final CoercionAction act ;
1346
+ // 18-Dec-2020, tatu: Formats without strong typing (XML, CSV, Properties at
1347
+ // least) should allow from-String "coercion" since Strings are their
1348
+ // native type.
1349
+ // One open question is whether Empty/Blank String are special; they might
1350
+ // be so only apply short-cut to other cases, for now
1347
1351
1352
+ final CoercionAction act ;
1348
1353
if (value .isEmpty ()) {
1349
1354
act = ctxt .findCoercionAction (logicalType , rawTargetType ,
1350
1355
CoercionInputShape .EmptyString );
@@ -1355,6 +1360,10 @@ protected CoercionAction _checkFromStringCoercion(DeserializationContext ctxt, S
1355
1360
return _checkCoercionFail (ctxt , act , rawTargetType , value ,
1356
1361
"blank String (all whitespace)" );
1357
1362
} else {
1363
+ // 18-Dec-2020, tatu: As per above, allow for XML, CSV, Properties
1364
+ if (ctxt .isEnabled (StreamReadCapability .UNTYPED_SCALARS )) {
1365
+ return CoercionAction .TryConvert ;
1366
+ }
1358
1367
act = ctxt .findCoercionAction (logicalType , rawTargetType , CoercionInputShape .String );
1359
1368
if (act == CoercionAction .Fail ) {
1360
1369
// since it MIGHT (but might not), create desc here, do not use helper
0 commit comments