chore: nelmio/apidocbundle and fos/restbundle integration
This commit is contained in:
@ -5,4 +5,8 @@ return [
|
||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
|
||||
Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true],
|
||||
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
||||
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
|
||||
];
|
||||
|
15
config/packages/fos_rest.yaml
Normal file
15
config/packages/fos_rest.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
# Read the documentation: https://symfony.com/doc/master/bundles/FOSRestBundle/index.html
|
||||
fos_rest: null
|
||||
# param_fetcher_listener: true
|
||||
# allowed_methods_listener: true
|
||||
# routing_loader: true
|
||||
# view:
|
||||
# view_response_listener: true
|
||||
# exception:
|
||||
# codes:
|
||||
# App\Exception\MyException: 403
|
||||
# messages:
|
||||
# App\Exception\MyException: Forbidden area.
|
||||
# format_listener:
|
||||
# rules:
|
||||
# - { path: ^/api, prefer_extension: true, fallback_format: json, priorities: [ json, html ] }
|
15
config/packages/nelmio_api_doc.yaml
Normal file
15
config/packages/nelmio_api_doc.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
nelmio_api_doc:
|
||||
documentation:
|
||||
info:
|
||||
title: Janus
|
||||
description: Service de gestion de profils dynamiques
|
||||
version: 0.0.0
|
||||
securityDefinitions:
|
||||
Bearer:
|
||||
type: apiKey
|
||||
description: 'Value: Bearer {jwt}'
|
||||
name: Authorization
|
||||
in: header
|
||||
areas: # to filter documented areas
|
||||
path_patterns:
|
||||
- ^/api(?!/doc(\.json)?$) # Accepts routes under /api except /api/doc
|
2
config/packages/test/twig.yaml
Normal file
2
config/packages/test/twig.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
twig:
|
||||
strict_variables: true
|
5
config/packages/twig.yaml
Normal file
5
config/packages/twig.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
twig:
|
||||
default_path: '%kernel.project_dir%/templates'
|
||||
debug: '%kernel.debug%'
|
||||
strict_variables: '%kernel.debug%'
|
||||
exception_controller: null
|
12
config/routes/nelmio_api_doc.yaml
Normal file
12
config/routes/nelmio_api_doc.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
# Expose your documentation as JSON swagger compliant
|
||||
app.swagger:
|
||||
path: /api/doc.json
|
||||
methods: GET
|
||||
defaults: { _controller: nelmio_api_doc.controller.swagger }
|
||||
|
||||
## Requires the Asset component and the Twig bundle
|
||||
## $ composer require twig asset
|
||||
app.swagger_ui:
|
||||
path: /api/doc
|
||||
methods: GET
|
||||
defaults: { _controller: nelmio_api_doc.controller.swagger_ui }
|
Reference in New Issue
Block a user