{"id":27765051,"url":"https://github.com/handofgod94/json_rpc","last_synced_at":"2025-04-29T15:41:57.957Z","repository":{"id":287605115,"uuid":"965249562","full_name":"HandOfGod94/json_rpc","owner":"HandOfGod94","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-12T18:50:32.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T19:35:11.369Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HandOfGod94.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-04-12T18:33:35.000Z","updated_at":"2025-04-12T18:50:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"ab61b444-c2ec-4215-87ec-b6137e15789e","html_url":"https://github.com/HandOfGod94/json_rpc","commit_stats":null,"previous_names":["handofgod94/json_rpc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HandOfGod94%2Fjson_rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HandOfGod94%2Fjson_rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HandOfGod94%2Fjson_rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HandOfGod94%2Fjson_rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HandOfGod94","download_url":"https://codeload.github.com/HandOfGod94/json_rpc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251530683,"owners_count":21604173,"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":[],"created_at":"2025-04-29T15:41:56.961Z","updated_at":"2025-04-29T15:41:57.948Z","avatar_url":"https://github.com/HandOfGod94.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON-RPC\n\nA lightweight, transport-agnostic JSON-RPC 1.0 implementation in Ruby that provides a simple way to handle JSON-RPC requests and responses.\n\n\u003e **Note:** This project is currently a work in progress. It implements JSON-RPC 1.0 specification and is being actively developed.\n\n## Features\n\n- Simple and clean API for handling JSON-RPC requests\n- Built-in request validation\n- Customizable routing system with yield-based DSL\n- Error handling for common JSON-RPC scenarios\n- Transport-agnostic design (works with HTTP, WebSocket, or any other transport layer)\n- JSON-RPC 1.0 specification compliant\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'json_rpc'\n```\n\nAnd then execute:\n\n```bash\n$ bundle install\n```\n\nOr install it yourself as:\n\n```bash\n$ gem install json_rpc\n```\n\n## Usage\n\n```ruby\nrequire 'json_rpc'\n\n# Define your routes using the yield-based router\nrouter = JsonRpc::Router.define do |r|\n  r.rpc :add do |a, b|\n    a + b\n  end\n\n  r.rpc :ping do\n    'pong'\n  end\nend\n\n# Handle a request using invoke\nrequest = '{\"jsonrpc\": \"1.0\", \"method\": \"add\", \"params\": [1, 2], \"id\": 1}'\nresponse = router.invoke(request)\nputs response.to_json\n# =\u003e {\"jsonrpc\":\"1.0\",\"result\":3,\"id\":1}\n\n# Handle a ping request\nrequest = '{\"jsonrpc\": \"1.0\", \"method\": \"ping\", \"params\": [], \"id\": 2}'\nresponse = router.invoke(request)\nputs response.to_json\n# =\u003e {\"jsonrpc\":\"1.0\",\"result\":\"pong\",\"id\":2}\n```\n\n## Development\n\nAfter checking out the repo, run `bundle install` to install dependencies. Then, run `rake test` to run the tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandofgod94%2Fjson_rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhandofgod94%2Fjson_rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandofgod94%2Fjson_rpc/lists"}