{"id":28892831,"url":"https://github.com/battlegrounds/minjson","last_synced_at":"2025-06-27T09:03:38.660Z","repository":{"id":300228571,"uuid":"1005574501","full_name":"BattleGrounds/MinJSON","owner":"BattleGrounds","description":"Minimalistic JSON library for modern C++20","archived":false,"fork":false,"pushed_at":"2025-06-20T13:56:39.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-20T14:41:14.361Z","etag":null,"topics":["cpp20","json","minimal","modern-cpp"],"latest_commit_sha":null,"homepage":"https://battlegrounds.github.io/MinJSON/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BattleGrounds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2025-06-20T12:53:02.000Z","updated_at":"2025-06-20T13:56:16.000Z","dependencies_parsed_at":"2025-06-20T14:41:33.831Z","dependency_job_id":"272dfa8b-854c-4558-b673-ee9c9627c6cb","html_url":"https://github.com/BattleGrounds/MinJSON","commit_stats":null,"previous_names":["battlegrounds/minjson"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BattleGrounds/MinJSON","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BattleGrounds%2FMinJSON","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BattleGrounds%2FMinJSON/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BattleGrounds%2FMinJSON/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BattleGrounds%2FMinJSON/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BattleGrounds","download_url":"https://codeload.github.com/BattleGrounds/MinJSON/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BattleGrounds%2FMinJSON/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261050697,"owners_count":23102556,"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":["cpp20","json","minimal","modern-cpp"],"created_at":"2025-06-21T02:06:45.336Z","updated_at":"2025-06-24T05:03:11.999Z","avatar_url":"https://github.com/BattleGrounds.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧩 MinJSON – минималистичная JSON-библиотека для C++20\n\n**MinJSON** — это легковесная, высокопроизводительная JSON-библиотека с поддержкой:\n\n- ✅ C++20-концептов (`MinJSONValueType`)\n- ✅ Полноценного парсинга и сериализации\n- ✅ Типобезопасного доступа через пути (`\"user.name[0].value\"`)\n- ✅ Макросной рефлексии (в стиле `nlohmann::json`)\n- ✅ Кэширования путей (`thread_local`)\n- ✅ Совместима с STL: `std::string`, `std::vector`, `std::optional`\n\n## 🚀 Пример использования\n\n### 📌 Парсинг и доступ\n\n```cpp\n#include \"MinJSON.hpp\"\n\nint main() {\n    MinJSON json;\n    auto result = json.parse(R\"({\"user\":{\"name\":\"Alice\",\"age\":30}})\");\n\n    if (std::holds_alternative\u003cMinJSON::Error\u003e(result)) {\n        std::cerr \u003c\u003c \"Error: \" \u003c\u003c std::get\u003cMinJSON::Error\u003e(result) \u003c\u003c \"\\n\";\n        return 1;\n    }\n\n    const auto\u0026 data = std::get\u003cMinJSON::Value\u003e(result);\n    std::string name = json.get\u003cstd::string\u003e(data, \"user.name\");\n    int age = json.get\u003cint\u003e(data, \"user.age\");\n\n    std::cout \u003c\u003c name \u003c\u003c \" is \" \u003c\u003c age \u003c\u003c \" years old\\n\";\n}\n```\n\n### 📌 Макросная рефлексия\n\n```cpp\n#include \"MinJSON.hpp\"\n\nstruct User {\n    int id;\n    std::string name;\n};\n\nMINJSON_REGISTER_TYPE(User,\n    MINJSON_FIELD(id)\n    MINJSON_FIELD(name)\n)\n\nint main() {\n    MinJSON json;\n    MinJSON_register_User(json);\n\n    User user{42, \"Bob\"};\n    auto value = json.to_json(user);\n    std::cout \u003c\u003c json.stringify(value, true) \u003c\u003c \"\\n\";\n\n    auto user2 = json.from_json\u003cUser\u003e(value);\n    std::cout \u003c\u003c user2.name \u003c\u003c \"\\n\";\n}\n```\n\n## 🔧 Сборка через CMake\n\n```bash\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\n## 📄 Лицензия\n\nMIT License. Свободно для использования в любых целях.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbattlegrounds%2Fminjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbattlegrounds%2Fminjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbattlegrounds%2Fminjson/lists"}