• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 10993643100

23 Sep 2024 11:49AM UTC coverage: 7.353% (-0.5%) from 7.833%
10993643100

push

github

web-flow
fix(laravel): swagger ui authentication (#6661)

fix swagger ui authentication in laravel, by providing necessary options

Closes: #6662

0 of 43 new or added lines in 3 files covered. (0.0%)

1761 existing lines in 113 files now uncovered.

12127 of 164922 relevant lines covered (7.35%)

27.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Laravel/config/api-platform.php
1
<?php
2

3
use ApiPlatform\Metadata\UrlGeneratorInterface;
4
use Illuminate\Auth\Access\AuthorizationException;
5
use Illuminate\Auth\AuthenticationException;
6

7
return [
×
8
    'title' => 'API Platform',
×
9
    'description' => 'My awesome API',
×
10
    'version' => '1.0.0',
×
11

12
    'routes' => [
×
13
    ],
×
14

15
    /*
16
     * Where are ApiResource defined
17
     * TODO: link the docs on how to plug on eloquent models or create apiResource like controllers :D
18
     */
19
    'resources' => [
×
20
        app_path('Models'),
×
21
    ],
×
22

23
    'formats' => [
×
24
        'jsonld' => ['application/ld+json'],
×
25
        //'jsonapi' => ['application/vnd.api+json'],
×
26
        //'csv' => ['text/csv'],
×
27
    ],
×
28

29
    'patch_formats' => [
×
30
        'json' => ['application/merge-patch+json'],
×
31
    ],
×
32

33
    'docs_formats' => [
×
34
        'jsonld' => ['application/ld+json'],
×
35
        //'jsonapi' => ['application/vnd.api+json'],
36
        'jsonopenapi' => ['application/vnd.openapi+json'],
×
37
        'html' => ['text/html'],
×
38
    ],
×
39

40
    'error_formats' => [
×
41
        'jsonproblem' => ['application/problem+json'],
×
42
    ],
×
43

44
    'defaults' => [
×
45
        'pagination_enabled' => true,
×
46
        'pagination_partial' => false,
×
47
        'pagination_client_enabled' => false,
×
48
                'pagination_client_items_per_page' => false,
×
49
                'pagination_client_partial' => false,
×
50
                'pagination_items_per_page' => 30,
×
51
                'pagination_maximum_items_per_page' => 30,
×
52
        'route_prefix' => '/api',
×
53
        'middleware' => [],
×
54
    ],
×
55

56
        'pagination' => [
×
57
                'page_parameter_name' => 'page',
×
58
                'enabled_parameter_name' => 'pagination',
×
59
                'items_per_page_parameter_name' => 'itemsPerPage',
×
60
                'partial_parameter_name' => 'partial',
×
61
        ],
×
62

63
    'graphql' => [
×
64
        'enabled' => false,
×
65
        'nesting_separator' => '__',
×
66
        'introspection' => ['enabled' => true]
×
67
    ],
×
68

69
    'exception_to_status' => [
×
70
        AuthenticationException::class => 401,
×
71
        AuthorizationException::class => 403
×
72
    ],
×
73

74
    'swagger_ui' => [
×
NEW
75
        'enabled' => true,
×
NEW
76
        //'apiKeys' => [
×
NEW
77
        //    'api' => [
×
NEW
78
        //        'type' => 'Bearer',
×
NEW
79
        //        'name' => 'Authentication Token',
×
NEW
80
        //        'in' => 'header'
×
NEW
81
        //    ]
×
NEW
82
        //],
×
NEW
83
        //'oauth' => [
×
NEW
84
        //    'enabled' => true,
×
NEW
85
        //    'type' => 'oauth2',
×
NEW
86
        //    'flow' => 'authorizationCode',
×
NEW
87
        //    'tokenUrl' => '',
×
NEW
88
        //    'authorizationUrl' =>'',
×
NEW
89
        //    'refreshUrl' => '',
×
NEW
90
        //    'scopes' => ['scope1' => 'Description scope 1'],
×
NEW
91
        //    'pkce' => true
×
NEW
92
        //]
×
UNCOV
93
    ],
×
94

95
    'url_generation_strategy' => UrlGeneratorInterface::ABS_PATH,
×
96

97
    'serializer' => [
×
98
        'hydra_prefix' => false,
×
99
        // 'datetime_format' => \DateTimeInterface::RFC3339
×
100
    ]
×
101
];
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc