[cpp-pistache] removed model namespace when unused for operations (#775)

* Remove using model namespace when model is unused
* Add comments to clarify introduction of hasModelImport at API/operations level instead of operation/vendorExtensions level.
This commit is contained in:
sunn 2018-08-24 10:52:01 +02:00 committed by GitHub
parent 010b469914
commit 6a00b2a802
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -246,11 +246,13 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
} }
op.vendorExtensions.put("x-codegen-pistache-consumesJson", consumeJson); op.vendorExtensions.put("x-codegen-pistache-consumesJson", consumeJson);
op.vendorExtensions.put("x-codegen-pistache-isParsingSupported", isParsingSupported); 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) { for(String hdr : op.imports) {
if(importMapping.containsKey(hdr)) { if(importMapping.containsKey(hdr)) {
continue; continue;
} }
additionalProperties.put("hasModelImport", true); operations.put("hasModelImport", true);
} }
} }