{"id":19492843,"url":"https://github.com/oatpp/oatpp-protobuf","last_synced_at":"2025-06-10T09:03:57.707Z","repository":{"id":94411410,"uuid":"296159284","full_name":"oatpp/oatpp-protobuf","owner":"oatpp","description":"Use protobuf messages as regular oatpp DTOs","archived":false,"fork":false,"pushed_at":"2022-09-28T22:37:02.000Z","size":47,"stargazers_count":6,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T11:10:37.972Z","etag":null,"topics":["cpp","dto","oatpp","protobuf"],"latest_commit_sha":null,"homepage":"https://oatpp.io/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oatpp.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}},"created_at":"2020-09-16T22:16:24.000Z","updated_at":"2025-04-27T19:31:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"f12b19c5-5d3c-4854-a413-6b637a16a925","html_url":"https://github.com/oatpp/oatpp-protobuf","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"71b26be6c0028758dc61b4ce94bfd51e353a53f3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-protobuf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-protobuf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-protobuf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-protobuf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oatpp","download_url":"https://codeload.github.com/oatpp/oatpp-protobuf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-protobuf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258460383,"owners_count":22704733,"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":["cpp","dto","oatpp","protobuf"],"created_at":"2024-11-10T21:23:16.989Z","updated_at":"2025-06-10T09:03:57.681Z","avatar_url":"https://github.com/oatpp.png","language":"C++","readme":"# oatpp-protobuf\n\n**Alpha**  \n**Since oatpp 1.2.0**\n\nProtobuf messages integration with oatpp object-mapping framework.\n\nNow you can use protobuf messages as regular oatpp DTOs!\n\n\nMore about Oat++:\n\n- [Oat++ Website](https://oatpp.io/)\n- [Oat++ Github Repository](https://github.com/oatpp/oatpp)\n\n## Usage\n\nLet's say we have a .proto file:\n\n```proto\nsyntax = \"proto3\";\n\nmessage User {\n    enum Role {\n        ADMIN = 0;\n        GUEST = 1;\n    }\n    string name = 1;\n    Role role = 2;\n}\n```\n\n### In Endpoint\n\n```cpp\nENDPOINT(\"POST\", \"createUser\", createUser, \n         BODY_DTO(oatpp::protobuf::Object\u003cUser\u003e, user)) \n{\n  auto name = user-\u003ename();\n  auto role = user-\u003erole();\n  ...\n  return createResponse(Status::CODE_200, \"OK\");\n}\n```\n\n```cpp\nENDPOINT(\"GET\", \"getUser\", getUser) \n{\n  oatpp::protobuf::Object\u003cUser\u003e user = std::make_shared\u003cUser\u003e();\n  user-\u003eset_name(\"Ivan\");\n  user-\u003eset_role(User_Role_GUEST);\n  return createDtoResponse(Status::CODE_200, user);\n}\n```\n\nOutput:\n\n```json\n{\n  \"name\": \"Ivan\",\n  \"role\": \"GUEST\"\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Foatpp-protobuf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foatpp%2Foatpp-protobuf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Foatpp-protobuf/lists"}