Skip to content

Commit

Permalink
[cpp-pistache] removed model namespace when unused for operations (#775)
Browse files Browse the repository at this point in the history
* Remove using model namespace when model is unused
* Add comments to clarify introduction of hasModelImport at API/operations level instead of operation/vendorExtensions level.
  • Loading branch information
etherealjoy committed Aug 24, 2018
1 parent 010b469 commit 6a00b2a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,13 @@ public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> o
}
op.vendorExtensions.put("x-codegen-pistache-consumesJson", consumeJson);
op.vendorExtensions.put("x-codegen-pistache-isParsingSupported", isParsingSupported);

// Check if any one of the operations needs a model, then at API file level, at least one model has to be included.
for(String hdr : op.imports) {
if(importMapping.containsKey(hdr)) {
continue;
}
additionalProperties.put("hasModelImport", true);
operations.put("hasModelImport", true);
}
}

Expand Down

0 comments on commit 6a00b2a

Please sign in to comment.