forked from loafle/openapi-generator-original
UE4 client generator fixes (#6438)
* Added the possibility for a codegen to set the location of the generated model files, similarly to API files. * Removed std::shared_ptr from the generated types. Types in UE4Codegen are handled as POD structs, not shared pointers. * Fixed handling of body parameters as per the specification, the single body object is written directly as the payload. * Fixed handling of files and binaries, if a field is both isFile and isBinary, file will take precedence. * Updated cpp-ue4 client samples * Fixed handling of enums in models Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
@@ -43,9 +43,7 @@ void OpenAPIUserApi::CreateUserRequest::SetupHttpRequest(const TSharedRef<IHttpR
|
||||
FString JsonBody;
|
||||
JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody);
|
||||
|
||||
Writer->WriteObjectStart();
|
||||
Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body);
|
||||
Writer->WriteObjectEnd();
|
||||
WriteJsonValue(Writer, Body);
|
||||
Writer->Close();
|
||||
|
||||
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8"));
|
||||
@@ -102,9 +100,7 @@ void OpenAPIUserApi::CreateUsersWithArrayInputRequest::SetupHttpRequest(const TS
|
||||
FString JsonBody;
|
||||
JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody);
|
||||
|
||||
Writer->WriteObjectStart();
|
||||
Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body);
|
||||
Writer->WriteObjectEnd();
|
||||
WriteJsonValue(Writer, Body);
|
||||
Writer->Close();
|
||||
|
||||
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8"));
|
||||
@@ -161,9 +157,7 @@ void OpenAPIUserApi::CreateUsersWithListInputRequest::SetupHttpRequest(const TSh
|
||||
FString JsonBody;
|
||||
JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody);
|
||||
|
||||
Writer->WriteObjectStart();
|
||||
Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body);
|
||||
Writer->WriteObjectEnd();
|
||||
WriteJsonValue(Writer, Body);
|
||||
Writer->Close();
|
||||
|
||||
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8"));
|
||||
@@ -433,9 +427,7 @@ void OpenAPIUserApi::UpdateUserRequest::SetupHttpRequest(const TSharedRef<IHttpR
|
||||
FString JsonBody;
|
||||
JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody);
|
||||
|
||||
Writer->WriteObjectStart();
|
||||
Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body);
|
||||
Writer->WriteObjectEnd();
|
||||
WriteJsonValue(Writer, Body);
|
||||
Writer->Close();
|
||||
|
||||
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8"));
|
||||
|
||||
Reference in New Issue
Block a user