forked from loafle/openapi-generator-original
* 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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user