{"id":16649503,"url":"https://github.com/rapptz/jsonpp","last_synced_at":"2026-02-26T03:22:13.661Z","repository":{"id":17981187,"uuid":"20984982","full_name":"Rapptz/jsonpp","owner":"Rapptz","description":"C++11 JSON parser and writer","archived":false,"fork":false,"pushed_at":"2017-07-10T01:15:02.000Z","size":354,"stargazers_count":21,"open_issues_count":3,"forks_count":6,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-09T17:05:01.669Z","etag":null,"topics":["c-plus-plus","c-plus-plus-11","json-parser"],"latest_commit_sha":null,"homepage":"http://rapptz.github.io/jsonpp/","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/Rapptz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-19T02:26:45.000Z","updated_at":"2023-09-08T16:48:21.000Z","dependencies_parsed_at":"2022-09-12T09:21:14.753Z","dependency_job_id":null,"html_url":"https://github.com/Rapptz/jsonpp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rapptz%2Fjsonpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rapptz%2Fjsonpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rapptz%2Fjsonpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rapptz%2Fjsonpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rapptz","download_url":"https://codeload.github.com/Rapptz/jsonpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074976,"owners_count":21043490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["c-plus-plus","c-plus-plus-11","json-parser"],"created_at":"2024-10-12T09:10:42.773Z","updated_at":"2026-02-26T03:22:13.634Z","avatar_url":"https://github.com/Rapptz.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## jsonpp\n\n[![Build Status](https://travis-ci.org/Rapptz/jsonpp.svg?branch=master)](https://travis-ci.org/Rapptz/jsonpp)\n\njsonpp is a header-only JSON parser and writer that is currently in development. It is a semi-strict\nparser that throws exceptions for errors.\n\njsonpp is licensed with the MIT license.\n\n## Features\n\n- Easy to use with a simple API.\n- No special null, array, or object types.\n    - `json::null` is a type alias to `std::nullptr_t`.\n    - `json::array` is `std::vector\u003cjson::value\u003e`.\n    - `json::object` is `std::map\u003cstd::string, json::value\u003e`.\n- Decently fast.\n- No dependencies, only the standard library and a C++11 compiler.\n\n## Documentation\n\nDocumentation is an on going process and can be found [here][docs]. Amongst documentation you\ncan also find examples.\n\n[docs]: http://rapptz.github.io/jsonpp\n\n## Example usage\n\n#### Parsing\n\n```cpp\n#include \u003cjsonpp/parser.hpp\u003e\n#include \u003ciostream\u003e\n\nint main() {\n    json::parser p;\n    json::value v;\n    try {\n        p.parse(\"[null, \\\"hello\\\", 10.0]\", v);\n        if(v.is\u003cjson::array\u003e()) {\n            for(auto\u0026\u0026 val : v.as\u003cjson::array\u003e()) {\n                std::cout \u003c\u003c val.as\u003cstd::string\u003e(\"stuff\");\n            }\n        }\n    }\n    catch(const std::exception\u0026 e) {\n        std::cerr \u003c\u003c e.what() \u003c\u003c '\\n';\n    }\n}\n```\n\nOutput:\n\u003cpre\u003e\nstuff hello stuff\n\u003c/pre\u003e\n\n#### Writing\n\n```cpp\n#include \u003cjsonpp/value.hpp\u003e\n#include \u003ciostream\u003e\n\nint main() {\n    json::value v = { nullptr, \"hello\", 10 };\n    json::object o = {\n        { \"key\", \"value\" },\n        { \"key2\", 2 },\n        { \"key3\", nullptr }\n    };\n    json::dump(std::cout, o);\n}\n```\n\nOutput:\n\u003cpre\u003e\n{\n    \"key\": \"value\",\n    \"key2\": 2,\n    \"key3\": null\n}\n\u003c/pre\u003e\n\n## Quirks and Specification\n\n- NaN and inf are currently allowed.\n- Comments, e.g. `// stuff` is planned to be supported in the future.\n- The parser is not destructive.\n- The parser is recursive descent.\n- Numbers are stored in a `double` just like JSON but `v.as\u003cint\u003e` and friends work with caution.\n- String is expected to be in UTF-8.\n- Some errors are not caught but effort has been made to catch a lot of errors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapptz%2Fjsonpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frapptz%2Fjsonpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapptz%2Fjsonpp/lists"}