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:
Samuel Kahn
2020-05-31 18:13:12 +02:00
committed by GitHub
parent a96e783f06
commit e3eb3c2f7d
25 changed files with 84 additions and 58 deletions

View File

@@ -33,7 +33,7 @@ public:
FString ComputePath() const final;
/* Pet object that needs to be added to the store */
std::shared_ptr<OpenAPIOpenAPIPet> Body;
OpenAPIPet Body;
};
class OPENAPI_API OpenAPIPetApi::AddPetResponse : public Response
@@ -89,7 +89,7 @@ public:
Sold,
};
/* Status values that need to be considered for filter */
TArray<std::shared_ptr<StatusEnum>> Status;
TArray<StatusEnum> Status;
};
class OPENAPI_API OpenAPIPetApi::FindPetsByStatusResponse : public Response
@@ -99,7 +99,7 @@ public:
void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final;
bool FromJson(const TSharedPtr<FJsonValue>& JsonObject) final;
TArray<std::shared_ptr<OpenAPIOpenAPIPet>> Content;
TArray<OpenAPIPet> Content;
};
/* Finds Pets by tags
@@ -114,7 +114,7 @@ public:
FString ComputePath() const final;
/* Tags to filter by */
TArray<std::shared_ptr<FString>> Tags;
TArray<FString> Tags;
};
class OPENAPI_API OpenAPIPetApi::FindPetsByTagsResponse : public Response
@@ -124,7 +124,7 @@ public:
void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final;
bool FromJson(const TSharedPtr<FJsonValue>& JsonObject) final;
TArray<std::shared_ptr<OpenAPIOpenAPIPet>> Content;
TArray<OpenAPIPet> Content;
};
/* Find pet by ID
@@ -163,7 +163,7 @@ public:
FString ComputePath() const final;
/* Pet object that needs to be added to the store */
std::shared_ptr<OpenAPIOpenAPIPet> Body;
OpenAPIPet Body;
};
class OPENAPI_API OpenAPIPetApi::UpdatePetResponse : public Response