api-scout / api-scout
A library with a few tools, to auto document your API
Installs: 2 425
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 2
Open Issues: 6
Type:symfony-bundle
Requires
- php: >=8.2
- ext-ctype: *
- ext-iconv: *
- symfony/expression-language: 6.3.*
- symfony/http-foundation: 6.3.*
- symfony/http-kernel: 6.3.*
- symfony/mime: 6.3.*
- symfony/property-access: 6.3.*
- symfony/property-info: 6.3.*
- symfony/serializer: 6.3.*
- willdurand/negotiation: ^3.1
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.8
- beberlei/assert: ^3.3
- behat/behat: ^3.13
- behat/mink: ^1.10
- doctrine/doctrine-bundle: ^2.10
- doctrine/orm: ^2.16
- friends-of-behat/mink-browserkit-driver: ^1.6
- friends-of-behat/mink-extension: ^2.7
- friends-of-behat/symfony-extension: ^2.4
- phpunit/phpunit: ^9.3
- ramsey/uuid: ^4.7
- symfony/asset: 6.3.*
- symfony/console: 6.3.*
- symfony/doctrine-bridge: 6.3.*
- symfony/dotenv: 6.3.*
- symfony/flex: ^2.3
- symfony/framework-bundle: 6.3.*
- symfony/http-client: 6.3.*
- symfony/intl: 6.3.*
- symfony/phpunit-bridge: ^6.3
- symfony/process: 6.3.*
- symfony/routing: 6.3.*
- symfony/runtime: 6.3.*
- symfony/twig-bundle: 6.3.*
- symfony/uid: 6.3.*
- symfony/validator: 6.3.*
- symfony/yaml: 6.3.*
- twig/twig: ^3.6
Suggests
- ramsey/uuid: To support Ramsey's UUID identifiers.
- symfony/asset: To support Symfony assets
- symfony/twig-bundle: To use the Swagger UI integration.
- symfony/uid: To support Symfony UUID/ULID identifiers.
Conflicts
This package is not auto-updated.
Last update: 2024-05-10 15:19:54 UTC
README
Introduction
This package uses the Symfony serializer
- Enjoy the magic of an auto generated Swagger API Documentation
- MapRequestPayload and MapQueryString to deserialize your Request
- Serialize automatically your Response by returning an object to the Controller
- Nice Symfony Validation Response
- A Pagination tool to help you with your collections
ApiScout will greatly help you develop your api without reinventing the wheel
You can choose to use those tools as well as not to use them without having to fight against ApiScout.
Installation
composer require api-scout/api-scout
<?php # config/bundles.php return [ // ... ApiScout\Bridge\Symfony\Bundle\ApiScoutBundle::class => ['all' => true] ];
# config/routes.yaml api_scout_swagger_ui: path: /api/docs.{_format} controller: api_scout.swagger_ui.action methods: GET format: html
Usage
Use one of the available attribute methods as follows
<?php namespace ApiScout\Controller; use ApiScout\Attribute\Get; final class GetBookController { #[Get('/books')] public function __invoke(string $id): BookOutput { return new BookOutput( 'PHPStan', 'There is only one level with PHPStan. The level max.' ); } }
Your api specification is now available at: /api/docs
Methods
OpenApi
Advanced
Migrate to Api-Scout
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate. For more information see the contributing guide
Credits
Created by Marvin Courcier.
This library is sponsored by Alximy