vgirol / jsonapi-structure
Tools to check content of a JSON:API request
Requires
- php: ^7.3|^8.0
- vgirol/jsonapi-constant: ^1.1
Requires (Dev)
- infection/infection: ~0.14
- phpunit/phpunit: ^9.0
- vgirol/phpunit-exception: ^2.1
README
This package provides a set of tools to check content of a request using the JSON:API specification.
Technologies
- PHP 7.3+
Installation
To install through composer, simply put the following in your composer.json
file:
{ "require-dev": { "vgirol/jsonapi-structure": "dev-master" } }
And then run composer install
from the terminal.
Quick Installation
Above installation can also be simplified by using the following command:
$ composer require vgirol/jsonapi-structure
Usage
use VGirol\JsonApiStructure\ValidateService; $json = [ 'data' => [ 'type' => 'resource', 'id' => '5' ], 'jsonapi' => [ 'version' => '1.0', 'meta' => [ 'key' => 'value' ] ] ]; $service = new ValidateService('POST'); $service->validateStructure($json);
Documentation
The API documentation is available in XHTML format at the url http://jsonapi-structure.girol.fr/docs/ref/index.html.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email vincent@girol.fr instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.