{"repo":"lode/jsonapi","free":true,"listed":false,"github":"https://github.com/lode/jsonapi","clone":"git clone https://github.com/lode/jsonapi.git","description":"Human-friendly library to implement JSON:API without needing to know the specification.","language":"PHP","stars":55,"topics":["jsonapi","json-api","json","api-server","php"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"jsonapi A simple and human-friendly library for api servers (php serving json). It allows you to generate json output according to the JSON:API v1.1 standard, while being easy to understand for people without knowledge of the jsonapi standard. The JSON:API standard makes it easy for clients to fetch multiple resources in one call and understand the relations between them. Read more about it at jsonapi.org. The library's code uses strict typing and is checked against a high standard in phpstan and rector. It is tested extensively with 99% coverage. Installation Use Composer require to get the latest stable version: The library requires php 8.2. Use the latest v2.x release for lower php versions. Upgrading from v1 or v2 If you used v1 or v2 of this library, see UPGRADE 1 TO 2.md or UPGRADE 2 TO 3.md on how to upgrade. Getting started A small resource example Which will result in: A collection of resources with relationships Which will result in: Turning an exception into jsonapi Which will result in: This can be useful for development. For production usage, you can better construct an ErrorsDocument with only specific values. Using extensions and profiles The Atomic Operations extension and the Cursor Pagination profile come packaged along. Any 3rd party of self-made extension can be applied with: Which will result in: A similar flow can be used for profiles. Other examples Examples for all kind of responses are in the /examples directory. Features This library supports v1.1 of","default_branch":null,"files":null,"tree":[],"storefront":"/r/lode","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/lode/jsonapi/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}