-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi-platform.php
119 lines (102 loc) · 3.22 KB
/
api-platform.php
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
use ApiPlatform\Metadata\UrlGeneratorInterface;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Auth\AuthenticationException;
return [
'title' => 'API Platform',
'description' => 'My awesome API',
'version' => '1.0.0',
'routes' => [
// Global middleware applied to every API Platform routes
// 'middleware' => []
],
'resources' => [
app_path('Models'),
],
'formats' => [
'jsonld' => ['application/ld+json'],
// 'jsonapi' => ['application/vnd.api+json'],
// 'csv' => ['text/csv'],
],
'patch_formats' => [
'json' => ['application/merge-patch+json'],
],
'docs_formats' => [
'jsonld' => ['application/ld+json'],
// 'jsonapi' => ['application/vnd.api+json'],
'jsonopenapi' => ['application/vnd.openapi+json'],
'html' => ['text/html'],
],
'error_formats' => [
'jsonproblem' => ['application/problem+json'],
],
'defaults' => [
'pagination_enabled' => true,
'pagination_partial' => false,
'pagination_client_enabled' => false,
'pagination_client_items_per_page' => false,
'pagination_client_partial' => false,
'pagination_items_per_page' => 30,
'pagination_maximum_items_per_page' => 30,
'route_prefix' => '/api',
'middleware' => [],
],
'pagination' => [
'page_parameter_name' => 'page',
'enabled_parameter_name' => 'pagination',
'items_per_page_parameter_name' => 'itemsPerPage',
'partial_parameter_name' => 'partial',
],
'graphql' => [
'enabled' => false,
'nesting_separator' => '__',
'introspection' => ['enabled' => true],
],
'exception_to_status' => [
AuthenticationException::class => 401,
AuthorizationException::class => 403,
],
'swagger_ui' => [
'enabled' => true,
// 'apiKeys' => [
// 'api' => [
// 'type' => 'Bearer',
// 'name' => 'Authentication Token',
// 'in' => 'header'
// ]
// ],
// 'oauth' => [
// 'enabled' => true,
// 'type' => 'oauth2',
// 'flow' => 'authorizationCode',
// 'tokenUrl' => '',
// 'authorizationUrl' =>'',
// 'refreshUrl' => '',
// 'scopes' => ['scope1' => 'Description scope 1'],
// 'pkce' => true
// ],
// 'license' => [
// 'name' => 'Apache 2.0',
// 'url' => 'https://www.apache.org/licenses/LICENSE-2.0.html',
// ],
// 'contact' => [
// 'name' => 'API Support',
// 'url' => 'https://www.example.com/support',
// 'email' => '[email protected]',
// ],
],
'url_generation_strategy' => UrlGeneratorInterface::ABS_PATH,
'serializer' => [
'hydra_prefix' => false,
// 'datetime_format' => \DateTimeInterface::RFC3339
],
];