forked from loafle/openapi-generator-original
Support FGuid with helpers (#9291)
This commit is contained in:
parent
51028f0c1b
commit
28e0d9b22e
@ -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<uint8>& 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<FJsonValue>& JsonValue, FDateTime&
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, FGuid& Value)
|
||||
{
|
||||
FString TmpValue;
|
||||
if (JsonValue->TryGetString(TmpValue))
|
||||
{
|
||||
return FGuid::Parse(TmpValue, Value);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, bool& Value)
|
||||
{
|
||||
bool TmpValue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user