Bonjour,

Je suis en train d'essayer de configurer le bundle NelmioApiDocBundle afin de pouvoir utiliser le token JWT pour être autorisé d'effectuer des requêtes à partir de la documentation de l'API que j'ai créée. Voici le contenu de mon fichier nelmio_api_doc.yaml :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 
# config\packages\nelmio_api_doc.yaml
 
nelmio_api_doc:
    documentation:
        info:
            title: Books
            description: Une API d'Open Classrooms avec des livres, des autrices et des auteurs !
            version: 2.0.0
paths:
    /api/login_check:
        post:
            operationId: postCredentialsItem
            tags:
                - Token
            summary: Permet d'obtenir le token JWT pour se logger.
            requestBody:
                description: Crée un nouveau token JWT
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/Credentials'
            responses:
                '200':
                    description: Récupère le token JWT
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Token'
        components:
            schemas:
                Token:
                    type: object
                    properties:
                        token:
                            type: string
                            readOnly: true
                Credentials:
                    type: object
                    properties:
                        username:
                            type: string
                            default: admin@bookapi.com
                        password:
                            type: string
                            default: password
            securitySchemes:
                bearerAuth:
                    type: apiKey
                    in: header
                    name: Authorization # or another header name
        security:
            - bearerAuth: []
    areas: # to filter documented areas
        path_patterns:
            - ^/api(?!/doc$) # Accepts routes under /api except /api/doc
Cependant, j'obtiens ce message d'erreur:

There is no extension able to load the configuration for "paths" (in "C:\Books\config/packages/nelmio_api_doc.yaml"). Looked for namespace "paths", found ""framework", "maker", "doctrine", "doctrine_migrations", "doctrine_fixtures", "sensio_framework_extra", "security", "lexik_jwt_authentication", "jms_serializer", "bazinga_hateoas", "nelmio_api_doc", "twig", "twig_extra", "web_profiler"" in C:\Books\config/packages/nelmio_api_doc.yaml (which is being imported from "C:\Books\src\Kernel.php").

Y a-t-il une idée comment on peut le résoudre?

Merci d'avance.