[Cpprest] Fixing issue #3773 (#3876)

* Fixed errors with cpprest client generation when generating a client that uses arrays of primitive types (vector) and file responses (HttpContent).

* Updated the petstore sample using script.

* Removed debug code.

* Removed extra newline to match master.

* Fixed binary file handling in cpprest. Updated petstore samples.

* Update readme to add Cummins to list

* Cleaning up for pull. Removing unnecessary changes.

* Fixing petstore

* Fixing error in build.

* Fixed error in stream copy for binary data

* Replaced tab with 4 spaces in all modified files.

Replaced tab with 4 spaces in all modified files.
This commit is contained in:
Scott Richter
2016-09-29 22:31:24 -04:00
committed by wing328
parent 3d231e4e4b
commit b2e2643fd2
36 changed files with 290 additions and 308 deletions

View File

@@ -217,6 +217,10 @@ public class CppRestClientCodegen extends DefaultCodegen implements CodegenConfi
if (methodResponse.getSchema() != null) {
CodegenProperty cm = fromProperty("response", methodResponse.getSchema());
op.vendorExtensions.put("x-codegen-response", cm);
if(cm.datatype == "HttpContent")
{
op.vendorExtensions.put("x-codegen-response-ishttpcontent", true);
}
}
}
}
@@ -267,7 +271,8 @@ public class CppRestClientCodegen extends DefaultCodegen implements CodegenConfi
Property inner = mp.getAdditionalProperties();
return getSwaggerType(p) + "<utility::string_t, " + getTypeDeclaration(inner) + ">";
}
if (p instanceof StringProperty || p instanceof DateProperty || p instanceof DateTimeProperty
if (p instanceof StringProperty || p instanceof DateProperty
|| p instanceof DateTimeProperty || p instanceof FileProperty
|| languageSpecificPrimitives.contains(swaggerType)) {
return toModelName(swaggerType);
}
@@ -289,7 +294,7 @@ public class CppRestClientCodegen extends DefaultCodegen implements CodegenConfi
return "0.0";
} else if (p instanceof FloatProperty) {
return "0.0f";
} else if (p instanceof IntegerProperty) {
} else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) {
return "0";
} else if (p instanceof LongProperty) {
return "0L";