mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-29 12:10:54 +00:00
[cpp-ue4] Add missing convertors for arbitrary-typed variables (#10276)
* Add missing convertors for TSharedPtr<FJsonValue> * Update samples
This commit is contained in:
parent
0948a95b8c
commit
ae5db7ee20
@ -212,6 +212,19 @@ inline FString CollectionToUrlString_multi(const TArray<T>& Collection, const TC
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr<FJsonValue>& Value)
|
||||||
|
{
|
||||||
|
if (Value.IsValid())
|
||||||
|
{
|
||||||
|
FJsonSerializer::Serialize(Value.ToSharedRef(), "", Writer, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Writer->WriteObjectStart();
|
||||||
|
Writer->WriteObjectEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr<FJsonObject>& Value)
|
inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr<FJsonObject>& Value)
|
||||||
{
|
{
|
||||||
if (Value.IsValid())
|
if (Value.IsValid())
|
||||||
@ -324,6 +337,12 @@ inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, bool& Value
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, TSharedPtr<FJsonValue>& JsonObjectValue)
|
||||||
|
{
|
||||||
|
JsonObjectValue = JsonValue;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, TSharedPtr<FJsonObject>& JsonObjectValue)
|
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, TSharedPtr<FJsonObject>& JsonObjectValue)
|
||||||
{
|
{
|
||||||
const TSharedPtr<FJsonObject>* Object;
|
const TSharedPtr<FJsonObject>* Object;
|
||||||
|
@ -221,6 +221,19 @@ inline FString CollectionToUrlString_multi(const TArray<T>& Collection, const TC
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr<FJsonValue>& Value)
|
||||||
|
{
|
||||||
|
if (Value.IsValid())
|
||||||
|
{
|
||||||
|
FJsonSerializer::Serialize(Value.ToSharedRef(), "", Writer, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Writer->WriteObjectStart();
|
||||||
|
Writer->WriteObjectEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr<FJsonObject>& Value)
|
inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr<FJsonObject>& Value)
|
||||||
{
|
{
|
||||||
if (Value.IsValid())
|
if (Value.IsValid())
|
||||||
@ -333,6 +346,12 @@ inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, bool& Value
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, TSharedPtr<FJsonValue>& JsonObjectValue)
|
||||||
|
{
|
||||||
|
JsonObjectValue = JsonValue;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, TSharedPtr<FJsonObject>& JsonObjectValue)
|
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, TSharedPtr<FJsonObject>& JsonObjectValue)
|
||||||
{
|
{
|
||||||
const TSharedPtr<FJsonObject>* Object;
|
const TSharedPtr<FJsonObject>* Object;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user