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:
dan-drl
2019-09-20 11:13:33 -07:00
committed by sunn
parent aadaac7e17
commit 0ea1ead59e
2 changed files with 3 additions and 3 deletions

View File

@@ -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);
}
}

View File

@@ -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}}