Rest API framework based on Symfony.
An API framework that can be placed on top of the Symfony2 (3) framework that allows you to easily create simple and complex RESTful API's.
- Full hateoas supported HTTP and REST apis (hateoasbundle / custom / noxlogic serializer)
- Commandline generators for resources (custom)
- Commandline configurator (custom)
- Auto routing for controllers (fosrest / custom)
- Content negotiation (custom)
- Multiple content output (noxlogic/jms serializerbundle)
- Rate limititing (noxlogic-ratelimit)
- OAuth authentication (fosoauth)
- basic authentication (symfony2)
- autogenerated documentation and sandboxing (custom / nelmioapidocbundle)
- API versioning (based on either url and/or accept-type)
- RAML support (http://raml.org/)
This bundle could be added to an existing project by a simple composer require
, however, it should be possible to bootstrap a system by using composer create-project
as well.
The system should be "plug and play". For instance, when a user wants to enable oauth for authentication, it should be a simple command to enable this. Underwater, it should do nothing more than include the correct bundle and instantiate this, so more advanced users can easily customize it as well.
A big drawback of existing bundles is that they all need to be configured manually, and not all of them are working in a proper rest-ful context way. For instance, the jms-serializer bundle works correctly in collaboration with bazingahateoas, but lacks the methodology of creating customized mappings, as it uses the simple expression language that maps entities to resources. However, a (database) entity is NOT a representation of a resource, which is what REST returns. The mapping of any entity (even "virtual entities" that do not have a database-entities, for instance), should be easily be done without resolving to very complex code written in either annotations or yaml configurations.
A complete rest-system would also make it much easier to get started in a proper way. Without worrying about what kind of error triggers what http code, a user could easily create a crud-controller for a resource with the correct code through a simple generator.
This bundle should aim to adhere the rest constraints as much as possible, but still allow to deviate from them for practial purposes. For instance, it might be that end-users would like to use complete API versioning through url (like: /api/v1/..
instead of resource versioning).
An API should be consumed, and the bundle should / could provide a simple way to do this. There could be a simple setup that generate DTO's for the given resources.
Since all the system should do, is install bundle, setup configuration and generate code, it should be easy for users to customize anything. But even without this customization, the system should be easy en flexible enough for most api's to begin with.