{"id":18446636,"url":"https://github.com/snorrwe/minijson","last_synced_at":"2026-04-25T12:36:03.630Z","repository":{"id":78385684,"uuid":"146133210","full_name":"snorrwe/minijson","owner":"snorrwe","description":"Lightweight json library for C++","archived":false,"fork":false,"pushed_at":"2019-10-16T15:51:52.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T09:54:34.298Z","etag":null,"topics":["json","json-library","json-parser","json-serialization","json-serializer"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snorrwe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-25T22:15:09.000Z","updated_at":"2024-03-15T21:31:43.000Z","dependencies_parsed_at":"2023-02-24T15:15:35.243Z","dependency_job_id":null,"html_url":"https://github.com/snorrwe/minijson","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/snorrwe/minijson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snorrwe%2Fminijson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snorrwe%2Fminijson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snorrwe%2Fminijson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snorrwe%2Fminijson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snorrwe","download_url":"https://codeload.github.com/snorrwe/minijson/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snorrwe%2Fminijson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32262801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","json-library","json-parser","json-serialization","json-serializer"],"created_at":"2024-11-06T07:09:52.332Z","updated_at":"2026-04-25T12:36:03.612Z","avatar_url":"https://github.com/snorrwe.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MiniJson\n\n[![Build Status](https://travis-ci.org/snorrwe/minijson.svg?branch=master)](https://travis-ci.org/snorrwe/minijson)\n[![codecov](https://codecov.io/gh/snorrwe/minijson/branch/master/graph/badge.svg)](https://codecov.io/gh/snorrwe/minijson)\n\nLightweight header-only JSON library written in C++17. Just include the headers and you're good to go. __MiniJSON__ is a very opinionated framework for parsing `JSON`.\n__MiniJSON__ might be a suitable for your application if your `JSON` communication has a very strict schema.\n\n## Requirements\n\n- C++17 compatible compiler\n\n## Usage\n\nTo be able to parse custom data structures the structures must provide a `static` `constexpr` method named `json_propertied` that returns a tuple of the `public` data members that we wish to serialise / parse.\n\n```cpp\nstruct Seed\n{\n    // Serialisable data members must be declared public\n    float radius = 0.0;\n\n    constexpr static auto json_properties()\n    {\n        return std::make_tuple(mini_json::property(\u0026Seed::radius, \"radius\"));\n    }\n};\n```\n\n## Usage example\n\n```cpp\n\n#include \"json.h\"\n\nstruct Seed\n{\n    float radius = 0.0;\n\n    constexpr static auto json_properties()\n    {\n        return std::make_tuple(mini_json::property(\u0026Seed::radius, \"radius\"));\n    }\n};\n\nstruct Apple\n{\n    std::string color = \"\";\n    int size = 0;\n    Seed seed;\n\n    constexpr static auto json_properties()\n    {\n        return std::make_tuple(mini_json::property(\u0026Apple::color, \"color\"),\n                               mini_json::property(\u0026Apple::seed, \"seed\"),\n                               mini_json::property(\u0026Apple::size, \"size\"));\n    }\n};\n\nTEST_F(TestJsonParser, CanReadJsonIntoObject)\n{\n    /*\n    {\n        \"color\":\"red\",\n        \"size\": -25,\n        \"seed\": {\n            \"radius\": -3.14\n        }\n    }\n    */\n    const auto json = \"{\\\"color\\\":\\\"red\\\",\\\"size\\\": -25,\\\"seed\\\":{\\\"radius\\\":-3.14}}\"s;\n\n    auto result = mini_json::parse\u003cApple\u003e(json.begin(), json.end());\n\n    EXPECT_EQ(result.color, \"red\");\n    EXPECT_EQ(result.size, -25);\n    EXPECT_FLOAT_EQ(result.seed.radius, -3.14f);\n}\n```\n\n## Supported types:\n\n- Any `T` that implements the `json_properties` static member function\n- `std::vector\u003cT\u003e` for any json serialisable `T`\n- `std::string`\n- `int`\n- `size_t`\n- `float`\n- `double`\n\n## Limitations:\n\n- `std::tuple` is not yet supported.\n- Optional fields are not supported.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnorrwe%2Fminijson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnorrwe%2Fminijson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnorrwe%2Fminijson/lists"}