free-elephants/json-api-toolkit

Tools for building specification first json:api / swagger integrated APIs


README

Build Status codecov Installs Releases

Features:

  • Build FastRoute Dispatcher by defined in OAS3 operationsIds values
  • Serialize Doctrine entities with Neomerx schemas (resolve issue neomerx/json-api#40)
  • Generate PHP Data Transfer Objects by OAS3 reponseBody and requestBody schema reference compliance with json:api
  • Map Psr Requests to Data Transfer Objects
  • Validate incoming Psr Requests with swagger specification and user defined rules, and build Psr Response with json:api errors
  • Map application models to Psr Response compliance with json:api structure

Usage

Install

composer require free-elephants/json-api-toolkit

Documentation

Available in /docs.

Index:

  1. Routing
  2. Serialize doctrine entities
  3. DTO from psr server request
  4. Validation

Development

All dev env is dockerized. Your can use make receipts and bin/ scripts without locally installed php, composer.

For run tests with different php version change PHP_VERSION value in .env and rebuild image with make build.