{"id":29228960,"url":"https://github.com/sshilko/php-api-myrpc-beta","last_synced_at":"2026-04-29T19:04:31.113Z","repository":{"id":215154163,"uuid":"600767447","full_name":"sshilko/php-api-myrpc-beta","owner":"sshilko","description":"(Beta) PHP API server and client","archived":false,"fork":false,"pushed_at":"2024-05-18T12:27:20.000Z","size":792,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-22T14:26:08.352Z","etag":null,"topics":["api-client","json-api","json-server"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/sshilko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT","threat_model":null,"audit":null,"citation":"CITATION","codeowners":".github/CODEOWNERS","security":".github/SECURITY","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sshilko","custom":"https://paypal.me/sergeishilko"}},"created_at":"2023-02-12T14:43:01.000Z","updated_at":"2024-05-18T12:26:19.000Z","dependencies_parsed_at":"2024-02-01T18:29:03.364Z","dependency_job_id":"206371f1-1caa-4d02-b936-11cf87347e89","html_url":"https://github.com/sshilko/php-api-myrpc-beta","commit_stats":null,"previous_names":["sshilko/php-api-myrpc-beta"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sshilko/php-api-myrpc-beta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshilko%2Fphp-api-myrpc-beta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshilko%2Fphp-api-myrpc-beta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshilko%2Fphp-api-myrpc-beta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshilko%2Fphp-api-myrpc-beta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sshilko","download_url":"https://codeload.github.com/sshilko/php-api-myrpc-beta/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshilko%2Fphp-api-myrpc-beta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32439339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["api-client","json-api","json-server"],"created_at":"2025-07-03T11:05:24.029Z","updated_at":"2026-04-29T19:04:31.097Z","avatar_url":"https://github.com/sshilko.png","language":"PHP","funding_links":["https://github.com/sponsors/sshilko","https://paypal.me/sergeishilko"],"categories":[],"sub_categories":[],"readme":"\u003c!---\nThis file is part of the sshilko/php-api-myrpc package.\n\n(c) Sergei Shilko \u003ccontact@sshilko.com\u003e\n\nMIT License\n\nFor the full copyright and license information, please view the LICENSE\nfile that was distributed with this source code.\n\n@license https://opensource.org/licenses/mit-license.php MIT\n--\u003e\n(Beta) MyAPI - Component\n=================\n\u003cp align=\"left\"\u003e\n\t\u003cimg src=\"https://img.shields.io/badge/status-active-success\" alt=\"Project status - beta\"\u003e\n\t\u003ca href=\"https://packagist.org/packages/sshilko/php-api-myrpc-beta\"\u003e\u003cimg src=\"https://poser.pugx.org/sshilko/php-api-myrpc-beta/v/stable\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://packagist.org/packages/sshilko/php-api-myrpc-beta/stats\"\u003e\u003cimg src=\"https://poser.pugx.org/sshilko/php-api-myrpc-beta/downloads\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://packagist.org/packages/sshilko/php-api-myrpc-beta\"\u003e\u003cimg src=\"https://poser.pugx.org/sshilko/php-api-myrpc-beta/require/php\" alt=\"PHP Required Version\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://choosealicense.com/licenses/mit/\"\u003e\u003cimg src=\"https://poser.pugx.org/sshilko/php-api-myrpc-beta/license\" alt=\"MIT License\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://psalm.dev/docs/running_psalm/command_line_usage/#shepherd\"\u003e\n    \u003cimg src=\"https://shepherd.dev/github/sshilko/php-api-myrpc-beta/coverage.svg\" alt=\"Psalm Coverage\"\u003e\u003c/a\u003e\n    \u003cimg src=\"https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fsshilko%2Fphp-sql-mydb\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23E7E7E7\u0026title=hits\u0026edge_flat=false\"/\u003e\n    \u003cimg src=\"https://img.shields.io/github/languages/code-size/sshilko/php-api-myrpc-beta\" alt=\"Code size\"\u003e\n    \u003cbr /\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/sshilko/php-api-myrpc-beta/pages/php/phpunit/phpunit-coverage-badge.svg\" alt=\"PHPUnit coverage\" /\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/sshilko/php-api-myrpc-beta/pages/php/phpunit/phpunit-coverage-badge-classes.svg\" alt=\"PHPUnit classes coverage\" /\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/sshilko/php-api-myrpc-beta/pages/php/phpunit/phpunit-coverage-badge-lines.svg\" alt=\"PHPUnit lines coverage\" /\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/sshilko/php-api-myrpc-beta/pages/php/phpunit/phpunit-coverage-badge-methods.svg\" alt=\"PHPUnit methods coverage\" /\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://sshilko.com/php-api-myrpc-beta/php/phan/\"\u003e\u003cimg src=\"https://github.com/sshilko/php-api-myrpc-beta/actions/workflows/phpphan.yml/badge.svg\" alt=\"Phan build\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://sshilko.com/php-api-myrpc-beta/php/psalm/\"\u003e\u003cimg src=\"https://github.com/sshilko/php-api-myrpc-beta/actions/workflows/phppsalm.yml/badge.svg\" alt=\"Psalm build\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://sshilko.com/php-api-myrpc-beta/php/phpmd/\"\u003e\u003cimg src=\"https://github.com/sshilko/php-api-myrpc-beta/actions/workflows/phpmd.yml/badge.svg\" alt=\"PHPMd build\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://sshilko.com/php-api-myrpc-beta/php/phpstan/\"\u003e\u003cimg src=\"https://github.com/sshilko/php-api-myrpc-beta/actions/workflows/phpstan.yml/badge.svg\" alt=\"PHPStan build\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://sshilko.com/php-api-myrpc-beta/php/phpcs/\"\u003e\u003cimg src=\"https://github.com/sshilko/php-api-myrpc-beta/actions/workflows/phpcs.yml/badge.svg\" alt=\"PHPCodeSniffer build\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://sshilko.com/php-api-myrpc-beta/php/phpdoc/\"\u003e\u003cimg src=\"https://github.com/sshilko/php-api-myrpc-beta/actions/workflows/phpdoc.yml/badge.svg\" alt=\"PHPDocumentor build\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://sshilko.com/php-api-myrpc-beta/php/pdepend/\"\u003e\u003cimg src=\"https://github.com/sshilko/php-api-myrpc-beta/actions/workflows/phppdepend.yml/badge.svg\" alt=\"Pdepend build\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://sshilko.com/php-api-myrpc-beta/php/phpunit/html/\"\u003e\u003cimg src=\"https://github.com/sshilko/php-api-myrpc-beta/actions/workflows/phpunit.yml/badge.svg\" alt=\"PHPUnit build\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/sshilko/php-api-myrpc-beta/actions/workflows/phpunit.yml\"\u003e\u003cimg src=\"https://github.com/sshilko/php-api-myrpc-beta/actions/workflows/phpunit.yml/badge.svg\" alt=\"PHPUnit build\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/sshilko/php-api-myrpc-beta/actions/workflows/github-pages.yml\"\u003e\u003cimg src=\"https://github.com/sshilko/php-api-myrpc-beta/actions/workflows/github-pages.yml/badge.svg\" alt=\"GithubPages build\"\u003e\u003c/a\u003e\n    \u003cbr/\u003e\n    \u003c/p\u003e\n\u003c/p\u003e\n\nPHP [JSON-RPC](https://www.jsonrpc.org) server and client with json-schema auto-generation and validation using DTO \n\n#### Installation\n\nPlease wait for initial public release at `sshilko/php-api-myrpc`.\n```\ncomposer require sshilko/php-api-myrpc-beta\n```\n\n#### Compatibility\n\n- PHP \u003e= 8.1\n\n#### Why RPC\n\nOver the years, first in 2007-2010 json became popular and took over the XML in the RPC space as more readable\nand browser/javascript friendly format. Few proposals were created to unify the request/response for the json rpc api.\n\nLater [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) took over by offering resource endpoints\nthat fit really nice for simple CRUD apps, but it required more upfront investment into designing your APIs,\nand as API codebase grew and usually in monolith new functionality been added, the complexity grew fast.\n\nREST API and JSON-RPC API comparison:\n- JSON-RPC is more loosely typed with [OSI-4 Transport layer](https://en.wikipedia.org/wiki/OSI_model)\n  - REST is stricter and defines OSI-7 Application layer\n- JSON-RPC reuses only json and [json-schema](https://json-schema.org) in contract definition\n  - REST may use multiple standards like [Swagger/OpenAPI](https://swagger.io), XML, JSON, [HATEOAS](https://en.wikipedia.org/wiki/HATEOAS), [JSON-LD](https://json-ld.org) and Hydra (Hydra is an extension of JSON-LD, essentially another OpenAPI standard) \n- JSON-RPC does not say anything about caching, as it does not rely on HTTP layer\n  - REST defines requirements about behaviour in caching, endpoint naming, Idempotence - in reality none of this is guaranteed by any framework, up to exact implementation by developer\n- REST api defines HTTP status codes to be used for response, which may lead to \"faster\" processing on client\n  - in practice most of the time the error message or error trace is still dispatched in the body and will be parsed by client\n  - in RPC, we do not rely on headers or cookies, error message format is documented in standard, error logging and response/transport are different concerns and should not be mixed\n\nTLDR\nREST requires good knowledge in both technology and domain to design proper API, enforces strict implementation rules.\nGRPC requires less preparation to start with, offers typed schema validation for input and output, implementation is flexible.\n\nin 2022 overall JSON-RPC evolved into [Google gRPC](https://grpc.io)\n- both are binary formats (either with HTTP1 or HTTP2 compressions) or json-rpc wrapped in [MsgPack](https://msgpack.org/index.html)\n- both are strictly typed, with json-rpc requires manual schema validation (library concern)\n- both provide some sort of auto generated schema for clients to build API contract\n\nJSON-RPC may not be as widespread as gRPC, but it is\n- simpler to adopt\n- works as reliable as HTTP (network guarantees), HTTP is available in any mobile/web/iot device\n- all existing HTTP tooling can be reused (initial json benefits) during development\n- one can easily adopt REST, gRPC or Swagger if already implemented JSON-RPC (rarely the case other way)\n- [OpenAPI v3](https://swagger.io/specification/) Swagger is almost compatible with JSON-RPC \n\n#### What is the best use-case for this library\n\n- [Facade](https://en.wikipedia.org/wiki/Facade_pattern) for the business logic\n- Simplicity focused, not a generic one-fit-all solution\n- Minimum 3rd party dependencies\n- No compilation required\n- JSON-Schema auto generation for clients\n\n#### Out of scope\n\nThis library is **not** intending to become a framework, to *keep focus* and minimize codebase, it does **NOT provide**:\n\n- HTML or other easy way to navigate the API, this can be achieved with 3rd party json-schema transpilers\n- Non JSON based API, this implementation focuses on JSON representation\n  - other wrapping/format is supported, please contribute your implementations\n- Authorization, authentication, security or other components required for full-fledged user-facing web-application\n\nplease re-use existing solutions that best fit your requirements.\n\n#### Why this library exists\n\n* [APIPlatform](https://api-platform.com) is overcomplicated and long-term commitment, \n  * depends **heavily** on Doctrine and Symfony\n  * large codebase with hidden complexity and maintainability issues\n* [zendframework/zend-json-server](https://github.com/zendframework/zend-json-server) abandoned and non-flexible\n* Simple facade for business logic with I/O validation is always needed in API-first application\n* Re-use the power of strict typed I/O with standard error messages that PHP8 provides\n* Simple, fast, easy to read and extend for your needs, easy to iterate and contribute to\n\n#### Future roadmap\n\n- 1.0 stable release\n\n#### Contributing\n\n* Please read [contributing](CONTRIBUTING) document\n\n#### Authors\n\nSergei Shilko \u003ccontact@sshilko.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshilko%2Fphp-api-myrpc-beta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsshilko%2Fphp-api-myrpc-beta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshilko%2Fphp-api-myrpc-beta/lists"}