Skip to content

enhancement: Remove json.hpp (3rd party dependency) #19

Open
3 of 5 issues completed
Open
@pooranjoyb

Description

@pooranjoyb

The current version uses json.hpp to handle API payloads efficiently with JSON data. Check nholmann/json for reference.

But as this is a 3rd party dependency, we need to make changes in the APIs (that uses nholmann/json) so that we can replace json.hpp header completely from our SDK. This dependency was initially used to fasten the development, but as we move forward with future versions, we can improve the SDK by removing external dependency and creating the payloads from scratch.

Example :

json payloadJson = {
{"databaseId", databaseId},
{"collectionId", collectionId},
{"key", key},
{"type", type},
{"attributes", attributes}
};

This has to be removed and updated to something like this

    std::string attributesStr = "[";
    for(auto attribute : attributes) {
        attributesStr += "\"" + attribute + "\",";
    }
    attributesStr.pop_back();
    attributesStr += "]";
    std::string payload = R"({"databaseId":")" + databaseId 
                            + R"(","collectionId":")" + collectionId 
                            + R"(","key":")" + key 
                            + R"(","type":")" + type 
                            + R"(","attributes":)" + attributesStr + R"(})";

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions