diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache index eb178e890af..67d60535987 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache @@ -105,6 +105,11 @@ inline FStringFormatArg ToStringFormatArg(const FDateTime& Value) return FStringFormatArg(Value.ToIso8601()); } +inline FStringFormatArg ToStringFormatArg(const FGuid& Value) +{ + return FStringFormatArg(Value.ToString(EGuidFormats::DigitsWithHyphens)); +} + inline FStringFormatArg ToStringFormatArg(const TArray& Value) { return FStringFormatArg(Base64UrlEncode(Value)); @@ -220,6 +225,11 @@ inline void WriteJsonValue(JsonWriter& Writer, const FDateTime& Value) Writer->WriteValue(Value.ToIso8601()); } +inline void WriteJsonValue(JsonWriter& Writer, const FGuid& Value) +{ + Writer->WriteValue(Value.ToString(EGuidFormats::DigitsWithHyphens)); +} + inline void WriteJsonValue(JsonWriter& Writer, const Model& Value) { Value.WriteJson(Writer); @@ -281,6 +291,17 @@ inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FDateTime& return false; } +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FGuid& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + return FGuid::Parse(TmpValue, Value); + } + else + return false; +} + inline bool TryGetJsonValue(const TSharedPtr& JsonValue, bool& Value) { bool TmpValue;