mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 14:40:53 +00:00
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());
|
return FStringFormatArg(Value.ToIso8601());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline FStringFormatArg ToStringFormatArg(const FGuid& Value)
|
||||||
|
{
|
||||||
|
return FStringFormatArg(Value.ToString(EGuidFormats::DigitsWithHyphens));
|
||||||
|
}
|
||||||
|
|
||||||
inline FStringFormatArg ToStringFormatArg(const TArray<uint8>& Value)
|
inline FStringFormatArg ToStringFormatArg(const TArray<uint8>& Value)
|
||||||
{
|
{
|
||||||
return FStringFormatArg(Base64UrlEncode(Value));
|
return FStringFormatArg(Base64UrlEncode(Value));
|
||||||
@ -220,6 +225,11 @@ inline void WriteJsonValue(JsonWriter& Writer, const FDateTime& Value)
|
|||||||
Writer->WriteValue(Value.ToIso8601());
|
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)
|
inline void WriteJsonValue(JsonWriter& Writer, const Model& Value)
|
||||||
{
|
{
|
||||||
Value.WriteJson(Writer);
|
Value.WriteJson(Writer);
|
||||||
@ -281,6 +291,17 @@ inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, FDateTime&
|
|||||||
return false;
|
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)
|
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, bool& Value)
|
||||||
{
|
{
|
||||||
bool TmpValue;
|
bool TmpValue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user