You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
else->throwIllegalStateException("Expected a construtor or method to create a Kotlin object, instead found ${_withArgsCreator.annotated.javaClass.name}")
27
+
} ?:returnsuper.createFromObjectWith(ctxt, props, buffer) // we cannot reflect this method so do the default Java-ish behavior
28
+
29
+
val jsonParmValueList = buffer.getParameters(props) // properties in order, null for missing or actual nulled parameters
30
+
31
+
// quick short circuit for special handling for no null checks needed and no optional parameters
32
+
if (jsonParmValueList.none { it ==null } && callable.parameters.none { it.isOptional }) {
// this is ok, optional parameter not resolved will have default parameter value of method
50
+
} elseif (paramVal ==null) {
51
+
if (paramDef.type.isMarkedNullable) {
52
+
// null value for nullable type, is ok
53
+
callableParametersByName.put(paramDef, null)
54
+
} else {
55
+
// missing value coming in as null for non-nullable type
56
+
throwJsonMappingException(null, "Instantiation of "+this.getValueTypeDesc() +" value failed for JSON property ${jsonProp.name} due to missing (therefore NULL) value for creator parameter ${paramDef.name} which is a non-nullable type")
57
+
}
58
+
} else {
59
+
// default value for datatype for non nullable type, is ok
60
+
callableParametersByName.put(paramDef, paramVal)
61
+
}
62
+
} else {
63
+
if (paramVal ==null&&!paramDef.type.isMarkedNullable) {
64
+
// value coming in as null for non-nullable type
65
+
throwJsonMappingException(null, "Instantiation of "+this.getValueTypeDesc() +" value failed for JSON property ${jsonProp.name} due to NULL value for creator parameter ${paramDef.name} which is a non-nullable type")
0 commit comments