mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 20:50:55 +00:00
update ue4 c++ client
This commit is contained in:
parent
033b946856
commit
3d7c173eb2
@ -22,7 +22,7 @@ public class OpenAPI : ModuleRules
|
||||
new string[]
|
||||
{
|
||||
"Core",
|
||||
"Http",
|
||||
"HTTP",
|
||||
"Json",
|
||||
}
|
||||
);
|
||||
|
@ -382,7 +382,7 @@ void OpenAPIPetApi::UpdatePetWithFormRequest::SetupHttpRequest(const FHttpReques
|
||||
// Default to Json Body request
|
||||
if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json")))
|
||||
{
|
||||
// Form parameters
|
||||
// Form parameters added to try to generate a json body when no body parameters are specified.
|
||||
FString JsonBody;
|
||||
JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody);
|
||||
Writer->WriteObjectStart();
|
||||
@ -470,7 +470,7 @@ void OpenAPIPetApi::UploadFileRequest::SetupHttpRequest(const FHttpRequestRef& H
|
||||
// Default to Json Body request
|
||||
if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json")))
|
||||
{
|
||||
// Form parameters
|
||||
// Form parameters added to try to generate a json body when no body parameters are specified.
|
||||
FString JsonBody;
|
||||
JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody);
|
||||
Writer->WriteObjectStart();
|
||||
@ -478,10 +478,7 @@ void OpenAPIPetApi::UploadFileRequest::SetupHttpRequest(const FHttpRequestRef& H
|
||||
Writer->WriteIdentifierPrefix(TEXT("additionalMetadata"));
|
||||
WriteJsonValue(Writer, AdditionalMetadata.GetValue());
|
||||
}
|
||||
if (File.IsSet()){
|
||||
Writer->WriteIdentifierPrefix(TEXT("file"));
|
||||
WriteJsonValue(Writer, File.GetValue());
|
||||
}
|
||||
UE_LOG(LogOpenAPI, Error, TEXT("Form parameter (file) was ignored, Files are not supported in json body"));
|
||||
Writer->WriteObjectEnd();
|
||||
Writer->Close();
|
||||
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8"));
|
||||
|
@ -103,12 +103,18 @@ FString Base64UrlEncode(const T& Value)
|
||||
return Base64String;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
template<typename T, typename std::enable_if<!std::is_base_of<Model, T>::value, int>::type = 0>
|
||||
inline FStringFormatArg ToStringFormatArg(const T& Value)
|
||||
{
|
||||
return FStringFormatArg(Value);
|
||||
}
|
||||
|
||||
template<typename T, typename std::enable_if<std::is_base_of<Model, T>::value, int>::type = 0>
|
||||
inline FStringFormatArg ToStringFormatArg(const T& EnumModelValue)
|
||||
{
|
||||
return FStringFormatArg(T::EnumToString(EnumModelValue.Value));
|
||||
}
|
||||
|
||||
inline FStringFormatArg ToStringFormatArg(const FDateTime& Value)
|
||||
{
|
||||
return FStringFormatArg(Value.ToIso8601());
|
||||
|
Loading…
x
Reference in New Issue
Block a user