Skip to content

Commit 604ae5c

Browse files
author
Roshin Rajan Panackal
committed
Log a warning for multiple array type fields
1 parent 41a9e61 commit 604ae5c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/CustomJavaClientCodegen.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,14 @@ private void useCreatorsForInterfaceSubtypes( @Nonnull final CodegenModel m )
307307
"Generating interface with mixed multiple non-primitive and primitive sub-types: {}. Deserialization may not work.";
308308
log.warn(msg, m.name);
309309
}
310+
var numArrayTypes = candidatesSingle.size() + candidatesMultipleND.size();
311+
if( numArrayTypes > 1 ) {
312+
final var msg =
313+
"Field can be oneOf %d array types. Deserialization may not work as expected."
314+
.formatted(numArrayTypes);
315+
log.warn(msg, m.name);
316+
}
317+
310318
candidates.clear();
311319
final var monads =
312320
Map

0 commit comments

Comments
 (0)