You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "PragmaTwice (via GitHub)" <gi...@apache.org> on 2024/07/02 17:08:48 UTC

Re: [PR] feat(json): add support of JSON.RESP command [kvrocks]

PragmaTwice commented on code in PR #2390:
URL: https://github.com/apache/kvrocks/pull/2390#discussion_r1661071835


##########
src/types/json.h:
##########
@@ -43,7 +43,14 @@
 
 template <class T>
 using Optionals = std::vector<std::optional<T>>;
-
+struct ArrayOrObjectPlaceHolder {};
+using VariantType = std::variant<std::string, int64_t, ArrayOrObjectPlaceHolder, bool>;
+template <typename T>
+struct JsonResp {
+  std::vector<std::unique_ptr<JsonResp<VariantType>>> children;
+  T value;
+  explicit JsonResp(T value) : value(std::move(value)) {}
+};

Review Comment:
   We can remove all of these types and just dump the RESP string directly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org