leankoala / leanapibundle
A small bundle for API request handling in Symfony
Installs: 7 999
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 10
Forks: 0
Open Issues: 0
This package is auto-updated.
Last update: 2024-10-26 08:55:32 UTC
README
The Leankoala LeanApiBundle is the foundation for using Symfony as restful API.
Components
- CORS Listener - this component handles the mandatory CORS headers. These are mandatory if the API should be accessible from a browser.
- ApiRequest - The API request handles the parameters within the HTTP request body. It also validates and casts the parameters like the Symfony ParamConverter.
First steps
The first steps explain how the LeanApiBundle gets installed and how the request data can be processed.
Installation
The LeanApiBundle can be installed via composer.
$ composer require leankoala/leanapibundle
Afterwards add the bundle in the AppKernel.php
.
$bundles = [ ... new LeankoalaLeanApiBundle(), ... ]
API routes
apiRequest Usage
$apiRequest = new ApiRequest( $symfonyRequest, $doctrine, $schema );
Ideas
The API bundle already does a lot but there are still a lot of things we want it to do additionally. This is a list of ideas:
- Auto-generate markdown from the schema arrays
- Use
@annotations
to inject theApiRequest
object with the correct schema - Schema as yml