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
msg ="Instantiation of ${this.valueTypeDesc} value failed for JSON property ${jsonProp.name} due to missing (therefore NULL) value for creator parameter ${paramDef.name} which is a non-nullable type"
77
+
).wrapWithPath(this.valueClass, jsonProp.name)
78
+
}
79
+
80
+
if (strictNullChecks && paramVal !=null) {
81
+
var paramType:String?=null
82
+
var itemType:KType?=null
83
+
if (jsonProp.type.isCollectionLikeType && paramDef.type.arguments.getOrNull(0)?.type?.isMarkedNullable ==false&& (paramVal asCollection<*>).any { it ==null }) {
if (jsonProp.type.isArrayType && paramDef.type.arguments.getOrNull(0)?.type?.isMarkedNullable ==false&& (paramVal asArray<*>).any { it ==null }) {
94
+
paramType ="array"
95
+
itemType = paramDef.type.arguments[0].type
96
+
}
97
+
98
+
if (paramType !=null&& itemType !=null) {
99
+
throwMissingKotlinParameterException(
100
+
parameter = paramDef,
101
+
processor = ctxt.parser,
102
+
msg ="Instantiation of $itemType$paramType failed for JSON property ${jsonProp.name} due to null value in a $paramType that does not allow null values"
103
+
).wrapWithPath(this.valueClass, jsonProp.name)
104
+
}
105
+
}
70
106
71
107
bucket[idx] = paramVal
72
108
}
@@ -159,7 +195,43 @@ internal class KotlinValueInstantiator(
msg ="Instantiation of ${this.valueTypeDesc} value failed for JSON property ${jsonProp.name} due to missing (therefore NULL) value for creator parameter ${paramDef.name} which is a non-nullable type"
206
+
).wrapWithPath(this.valueClass, jsonProp.name)
207
+
}
208
+
209
+
if (strictNullChecks && paramVal !=null) {
210
+
var paramType:String?=null
211
+
var itemType:KType?=null
212
+
if (jsonProp.type.isCollectionLikeType && paramDef.type.arguments.getOrNull(0)?.type?.isMarkedNullable ==false&& (paramVal asCollection<*>).any { it ==null }) {
if (jsonProp.type.isArrayType && paramDef.type.arguments.getOrNull(0)?.type?.isMarkedNullable ==false&& (paramVal asArray<*>).any { it ==null }) {
223
+
paramType ="array"
224
+
itemType = paramDef.type.arguments[0].type
225
+
}
226
+
227
+
if (paramType !=null&& itemType !=null) {
228
+
throwMissingKotlinParameterException(
229
+
parameter = paramDef,
230
+
processor = ctxt.parser,
231
+
msg ="Instantiation of $itemType$paramType failed for JSON property ${jsonProp.name} due to null value in a $paramType that does not allow null values"
val isGenericTypeVar = paramDef.type.javaType isTypeVariable<*>
191
-
val isMissingAndRequired = paramVal ==null&& isMissing && jsonProp.isRequired
192
-
if (isMissingAndRequired || (!isGenericTypeVar && paramVal ==null&&!paramDef.type.isMarkedNullable)) {
193
-
throwMissingKotlinParameterException(
194
-
parameter = paramDef,
195
-
processor = ctxt.parser,
196
-
msg ="Instantiation of ${this.valueTypeDesc} value failed for JSON property ${jsonProp.name} due to missing (therefore NULL) value for creator parameter ${paramDef.name} which is a non-nullable type"
197
-
).wrapWithPath(this.valueClass, jsonProp.name)
198
-
}
199
-
200
-
if (strictNullChecks && paramVal !=null) {
201
-
var paramType:String?=null
202
-
var itemType:KType?=null
203
-
if (jsonProp.type.isCollectionLikeType && paramDef.type.arguments.getOrNull(0)?.type?.isMarkedNullable ==false&& (paramVal asCollection<*>).any { it ==null }) {
if (jsonProp.type.isArrayType && paramDef.type.arguments.getOrNull(0)?.type?.isMarkedNullable ==false&& (paramVal asArray<*>).any { it ==null }) {
214
-
paramType ="array"
215
-
itemType = paramDef.type.arguments[0].type
216
-
}
217
-
218
-
if (paramType !=null&& itemType !=null) {
219
-
throwMissingKotlinParameterException(
220
-
parameter = paramDef,
221
-
processor = ctxt.parser,
222
-
msg ="Instantiation of $itemType$paramType failed for JSON property ${jsonProp.name} due to null value in a $paramType that does not allow null values"
0 commit comments