pz/jsonapi-resource

PHP 8.0 Library for parsing JSON:API resource in to data response.

dev-main 2021-01-08 09:22 UTC

This package is auto-updated.

Last update: 2024-05-08 16:40:49 UTC


README

PHP 8.0 Library for parsing JSON:API resource in to data response.

68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f707a2f6a736f6e6170692d7265736f75726365 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230362d627269676874677265656e2e7376673f7374796c653d666c6174 68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d5233566f4c7554314f6e65525f6a736f6e6170692d7265736f75726365266d65747269633d616c6572745f737461747573 68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5233566f4c7554314f6e65522f6a736f6e6170692d7265736f757263652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e

Installation

composer require pz/jsonapi-resource

Documentation

TODO

List of ideas and tasks must be implemented in the future.

  • Feat: Resource meta PHP attribute
  • Feat: Hydration or deserialization for resource creation or update.
  • Docs: Metadata guide
  • Docs: Full API Reference
  • Research: Possible performance improvements.

Development

There are Dockerfile and docker-compose config needed for developing the library on same environment configurations. We suggest using docker-compose for the library development.

Docker-compose local configurations

Please copy docker-compose.override-example.yaml to docker-compose.override.yaml and set proper user UID and desired build type.

First we need to build the docker image.

docker-compose build app

Lets install composer dependencies from the container.

docker-compose run app composer install

Testing

We are using PestPHP for unit testing the code, so please read about before test.

docker-compose run app pest

For syntax verification and checks we use PHPSTan.

docker-compose run app phpstan

Contributing

Fill free to create issues and send merge requests.

Before sending merge request please run phpstan and pest.