w2w / apie
apie is a library to convert plain old php objects into a REST API with OpenAPI spec.
Installs: 11 023
Dependents: 6
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 3
Requires
- php: ^7.2
- doctrine/annotations: ^1.6
- erasys/openapi-php: ^2.1|^3.0
- jeroen/rewindable-generator: ^1.2
- laminas/laminas-diactoros: ^2.1
- pagerfanta/pagerfanta: ^2.4
- phpdocumentor/reflection-docblock: ^4.3|5.*
- psr/cache: ^1.0
- psr/container: ^1.0
- psr/http-message: ^1.0
- ramsey/uuid: ^3.8
- symfony/cache: ^4.0|^5.0
- symfony/finder: ^4.3|^5.0
- symfony/http-kernel: ^4.0|^5.0
- symfony/property-access: ^4.0|^5.0
- symfony/property-info: ^4.0|^5.0
- symfony/serializer: ^4.3|^5.0
- w2w/apie-object-access-normalizer: ^2.0|>=2.0.1
Requires (Dev)
- doctrine/cache: ^1.9
- guzzlehttp/guzzle: ^6.3
- haydenpierce/class-finder: ^0.4.0
- jangregor/phpstan-prophecy: 0.5.1
- nesbot/carbon: *
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^0.12.3
- phpstan/phpstan-phpunit: 0.12.6
- phpunit/phpunit: ^7.0.0|^8.0.0
- tightenco/collect: ^7.12
- webonyx/graphql-php: ^0.13.8
This package is auto-updated.
Last update: 2022-06-12 09:58:43 UTC
README
library to convert simple POPO's (Plain Old PHP Objects), DTO (Data Transfer Objects) and Entities to a REST API with OpenAPI spec. It's still a work in progress, but there are tons of unit tests and a bridge to integrate the library in Laravel.
Since Apie version 3 it is also possible to add plugins to be modular.
Documentation:
- Installation
- How the mapping works
- PSR Controllers/routing
- Search filters
- Apie plugins
- Versioning
- Resource sub actions
Apie vs. Api Platform
This library is heavily inspired by the Symfony Api Platform, but there are some changes:
- This library is framework agnostic and requires a wrapper library to make it work in a framework. Api Platform core is framework agnostic, but it is hard to setup outside the symfony framework.
- In the Api Platform a resource provider or persister determines if it can persist or retrieve a specific resource with a supports() method. For Apie the resource class is explicitly linked to a service making it easier to select which HTTP methods are available.
- API Platform has no default serialization group if no serialization group is selected.
- So far APIE has less functionality for standards (JSON+LD, HAL) and no GraphQL support. Eventually we might add it.
- APIE is better capable of having api resources without an id.