forked from loafle/openapi-generator-original
Fix 3886 ishttpcontent not set (#3888)
* Fix issue deserializing to nullptr * Update codegen files * Fix error matching on DataType's value * Fix return type. Should be shared pointer
This commit is contained in:
@@ -242,7 +242,7 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen {
|
||||
if (response != null) {
|
||||
CodegenProperty cm = fromProperty("response", response);
|
||||
op.vendorExtensions.put("x-codegen-response", cm);
|
||||
if ("HttpContent".equals(cm.dataType)) {
|
||||
if ("std::shared_ptr<HttpContent>".equals(cm.dataType)) {
|
||||
op.vendorExtensions.put("x-codegen-response-ishttpcontent", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,9 +294,9 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r
|
||||
})
|
||||
.then([=](std::vector<unsigned char> localVarResponse)
|
||||
{
|
||||
HttpContent localVarResult;
|
||||
{{{returnType}}} localVarResult;
|
||||
std::shared_ptr<std::stringstream> stream = std::make_shared<std::stringstream>(std::string(localVarResponse.begin(), localVarResponse.end()));
|
||||
localVarResult.setData(stream);
|
||||
localVarResult->setData(stream);
|
||||
return localVarResult;
|
||||
{{/vendorExtensions.x-codegen-response-ishttpcontent}}
|
||||
{{^vendorExtensions.x-codegen-response-ishttpcontent}}
|
||||
|
||||
Reference in New Issue
Block a user