Skip to content

leankoala-gmbh/LeanApiBundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 

Repository files navigation

LeanApiBundle

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 the ApiRequest object with the correct schema
  • Schema as yml

Releases

No releases published

Packages

No packages published