@@ -285,8 +285,8 @@ public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> o
285
285
Map <String , Object > operations = (Map <String , Object >) objs .get ("operations" );
286
286
List <CodegenOperation > operationList = (List <CodegenOperation >) operations .get ("operation" );
287
287
for (CodegenOperation op : operationList ) {
288
- for (String hdr : op .imports ) {
289
- if (importMapping .containsKey (hdr )) {
288
+ for (String hdr : op .imports ) {
289
+ if (importMapping .containsKey (hdr )) {
290
290
continue ;
291
291
}
292
292
operations .put ("hasModelImport" , true );
@@ -295,7 +295,7 @@ public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> o
295
295
}
296
296
return objs ;
297
297
}
298
-
298
+
299
299
protected boolean isFileSchema (CodegenProperty property ) {
300
300
return property .baseType .equals ("HttpContent" );
301
301
}
@@ -411,7 +411,6 @@ public String getSchemaType(Schema p) {
411
411
412
412
@ Override
413
413
public Map <String , Object > postProcessAllModels (final Map <String , Object > models ) {
414
-
415
414
final Map <String , Object > processed = super .postProcessAllModels (models );
416
415
postProcessParentModels (models );
417
416
return processed ;
@@ -432,13 +431,18 @@ private void postProcessParentModels(final Map<String, Object> models) {
432
431
*/
433
432
private void processParentPropertiesInChildModel (final CodegenModel parent , final CodegenModel child ) {
434
433
final Map <String , CodegenProperty > childPropertiesByName = new HashMap <>(child .vars .size ());
435
- for (final CodegenProperty childSchema : child .vars ) {
436
- childPropertiesByName .put (childSchema .name , childSchema );
434
+ if (child != null && child .vars != null && !child .vars .isEmpty ()) {
435
+ for (final CodegenProperty childSchema : child .vars ) {
436
+ childPropertiesByName .put (childSchema .name , childSchema );
437
+ }
437
438
}
438
- for (final CodegenProperty parentSchema : parent .vars ) {
439
- final CodegenProperty duplicatedByParent = childPropertiesByName .get (parentSchema .name );
440
- if (duplicatedByParent != null ) {
441
- duplicatedByParent .isInherited = true ;
439
+
440
+ if (parent != null && parent .vars != null && !parent .vars .isEmpty ()) {
441
+ for (final CodegenProperty parentSchema : parent .vars ) {
442
+ final CodegenProperty duplicatedByParent = childPropertiesByName .get (parentSchema .name );
443
+ if (duplicatedByParent != null ) {
444
+ duplicatedByParent .isInherited = true ;
445
+ }
442
446
}
443
447
}
444
448
}
0 commit comments