@@ -15,8 +15,8 @@ api_platform:
15
15
# The version of the API.
16
16
version : ' 0.0.0'
17
17
18
- # Return IRIs as Absolute Urls .
19
- # ex. http://example.com/authors/1
18
+ # Return IRIs as Absolute URLs .
19
+ # ex: http://example.com/authors/1
20
20
absolute_url : false
21
21
22
22
# Set this to false if you want Webby to disappear.
@@ -31,12 +31,12 @@ api_platform:
31
31
# Specify a path name generator to use.
32
32
path_segment_name_generator : ' api_platform.path_segment_name_generator.underscore'
33
33
34
- # Allow using plain IDs for JSON format
34
+ # Allow using plain IDs for JSON format.
35
35
allow_plain_identifiers : false
36
36
37
37
validator :
38
- # Enable the serialization of payload fields when a validation error is thrown
39
- # If you want to serialize only some payload fields, define them like this [ severity, anotherPayloadField ]
38
+ # Enable the serialization of payload fields when a validation error is thrown.
39
+ # If you want to serialize only some payload fields, define them like this: [ severity, anotherPayloadField ]
40
40
serialize_payload_fields : []
41
41
42
42
eager_loading :
@@ -54,17 +54,18 @@ api_platform:
54
54
# If disabled, it will only join relations having the EAGER fetch mode.
55
55
force_eager : true
56
56
57
+ # Enabling the FOSUserBundle integration has been deprecated in 2.5 and will be removed in 3.0.
57
58
# Enable the FOSUserBundle integration.
58
59
enable_fos_user : false
59
60
60
61
# Enabling the NelmioApiDocBundle integration has been deprecated in 2.2 and will be removed in 3.0.
61
- # NelmioApiDocBundle 3 has native support for API Platform
62
+ # NelmioApiDocBundle 3 has native support for API Platform.
62
63
enable_nelmio_api_doc : false
63
64
64
65
# Enable the Swagger documentation and export.
65
66
enable_swagger : true
66
67
67
- # Enable Swagger ui .
68
+ # Enable Swagger UI .
68
69
enable_swagger_ui : true
69
70
70
71
# Enable ReDoc.
@@ -90,40 +91,47 @@ api_platform:
90
91
order_parameter_name : ' order'
91
92
92
93
pagination :
94
+ # The default name of the parameter handling the page number.
95
+ page_parameter_name : ' page'
96
+
97
+ # The name of the query parameter to enable or disable pagination.
98
+ enabled_parameter_name : ' pagination'
99
+
100
+ # The name of the query parameter to set the number of items per page.
101
+ items_per_page_parameter_name : ' itemsPerPage'
102
+
103
+ # The name of the query parameter to enable or disable the partial pagination.
104
+ partial_parameter_name : ' partial'
105
+
93
106
# To enable or disable pagination for all resource collections by default.
107
+ # Deprecated since 2.6 and will be removed in 3.0, use defaults.pagination_enabled instead.
94
108
enabled : true
95
109
96
110
# To allow partial pagination for all resource collections.
97
111
# This improves performances by skipping the `COUNT` query.
112
+ # Deprecated since 2.6 and will be removed in 3.0, use defaults.pagination_partial instead.
98
113
partial : false
99
114
100
115
# To allow the client to enable or disable the pagination.
116
+ # Deprecated since 2.6 and will be removed in 3.0, use defaults.pagination_client_enabled instead.
101
117
client_enabled : false
102
118
103
119
# To allow the client to set the number of items per page.
120
+ # Deprecated since 2.6 and will be removed in 3.0, use defaults.pagination_client_items_per_page instead.
104
121
client_items_per_page : false
105
122
106
123
# To allow the client to enable or disable the partial pagination.
124
+ # Deprecated since 2.6 and will be removed in 3.0, use defaults.pagination_client_partial instead.
107
125
client_partial : false
108
126
109
127
# The default number of items per page.
128
+ # Deprecated since 2.6 and will be removed in 3.0, use defaults.pagination_items_per_page instead.
110
129
items_per_page : 30
111
130
112
131
# The maximum number of items per page.
132
+ # Deprecated since 2.6 and will be removed in 3.0, use defaults.pagination_maximum_items_per_page instead.
113
133
maximum_items_per_page : ~
114
134
115
- # The default name of the parameter handling the page number.
116
- page_parameter_name : ' page'
117
-
118
- # The name of the query parameter to enable or disable pagination.
119
- enabled_parameter_name : ' pagination'
120
-
121
- # The name of the query parameter to set the number of items per page.
122
- items_per_page_parameter_name : ' itemsPerPage'
123
-
124
- # The name of the query parameter to enable or disable the partial pagination.
125
- partial_parameter_name : ' partial'
126
-
127
135
mapping :
128
136
# The list of paths with files or directories where the bundle will look for additional resource files.
129
137
paths : []
@@ -141,43 +149,43 @@ api_platform:
141
149
enabled : false
142
150
143
151
oauth :
144
- # To enable or disable oauth .
152
+ # To enable or disable OAuth .
145
153
enabled : false
146
154
147
- # The oauth client id .
155
+ # The OAuth client ID .
148
156
clientId : ' '
149
157
150
- # The oauth client secret.
158
+ # The OAuth client secret.
151
159
clientSecret : ' '
152
160
153
- # The oauth type.
161
+ # The OAuth type.
154
162
type : ' oauth2'
155
163
156
- # The oauth flow grant type.
164
+ # The OAuth flow grant type.
157
165
flow : ' application'
158
166
159
- # The oauth token url .
167
+ # The OAuth token URL .
160
168
tokenUrl : ' /oauth/v2/token'
161
169
162
- # The oauth authentication url .
170
+ # The OAuth authentication URL .
163
171
authorizationUrl : ' /oauth/v2/auth'
164
172
165
- # The oauth scopes.
173
+ # The OAuth scopes.
166
174
scopes : []
167
175
168
176
graphql :
169
- # Enabled by default with installed GraphQL
177
+ # Enabled by default with installed webonyx/graphql-php.
170
178
enabled : false
171
179
172
180
# The default IDE (graphiql or graphql-playground) used when going to the GraphQL endpoint. False to disable.
173
181
default_ide : ' graphiql'
174
182
175
183
graphiql :
176
- # Enabled by default with installed GraphQL and Twig
184
+ # Enabled by default with installed webonyx/graphql-php and Twig.
177
185
enabled : false
178
186
179
187
graphql_playground :
180
- # Enabled by default with installed GraphQL and Twig
188
+ # Enabled by default with installed webonyx/graphql-php and Twig.
181
189
enabled : false
182
190
183
191
# The nesting separator used in the filter names.
@@ -191,12 +199,12 @@ api_platform:
191
199
# The active versions of OpenAPI to be exported or used in the swagger_ui. The first value is the default.
192
200
versions : [2, 3]
193
201
194
- # The swagger api keys.
202
+ # The swagger API keys.
195
203
api_keys : []
196
- # The name of the header or query parameter containing the api key.
204
+ # The name of the header or query parameter containing the API key.
197
205
# name: ''
198
206
199
- # Whether the api key should be a query parameter or a header.
207
+ # Whether the API key should be a query parameter or a header.
200
208
# type: 'query' or 'header'
201
209
202
210
openapi :
@@ -218,40 +226,44 @@ api_platform:
218
226
url :
219
227
220
228
http_cache :
229
+ # To make all responses public by default.
230
+ public : ~
231
+
232
+ invalidation :
233
+ # To enable the tags-based cache invalidation system.
234
+ enabled : false
235
+
236
+ # URLs of the Varnish servers to purge using cache tags when a resource is updated.
237
+ varnish_urls : []
238
+
239
+ # To pass options to the client charged with the request.
240
+ request_options : []
241
+
221
242
# Automatically generate etags for API responses.
243
+ # Deprecated since 2.6 and will be removed in 3.0, use defaults.cache_headers.etag instead.
222
244
etag : true
223
245
224
246
# Default value for the response max age.
247
+ # Deprecated since 2.6 and will be removed in 3.0, use defaults.cache_headers.max_age instead.
225
248
max_age : 3600
226
249
227
250
# Default value for the response shared (proxy) max age.
251
+ # Deprecated since 2.6 and will be removed in 3.0, use defaults.cache_headers.shared_max_age instead.
228
252
shared_max_age : 3600
229
253
230
254
# Default values of the "Vary" HTTP header.
255
+ # Deprecated since 2.6 and will be removed in 3.0, use defaults.cache_headers.vary instead.
231
256
vary : ['Accept']
232
257
233
- # To make all responses public by default.
234
- public : ~
235
-
236
- invalidation :
237
- # To enable the tags-based cache invalidation system.
238
- enabled : false
239
-
240
- # URLs of the Varnish servers to purge using cache tags when a resource is updated.
241
- varnish_urls : []
242
-
243
- # To pass options to the client charged with the request.
244
- request_options : []
245
-
246
258
mercure :
247
- # Enabled by default with installed symfony/mercure-bundle
259
+ # Enabled by default with installed symfony/mercure-bundle.
248
260
enabled : false
249
261
250
262
# The URL sent in the Link HTTP header. If not set, will default to MercureBundle's default hub URL.
251
263
hub_url : null
252
264
253
265
messenger :
254
- # Enabled by default with installed symfony/messenger and not installed symfony/symfony
266
+ # Enabled by default with installed symfony/messenger and not installed symfony/symfony.
255
267
enabled : false
256
268
257
269
elasticsearch :
@@ -303,4 +315,100 @@ api_platform:
303
315
mime_types : ['application/ld+json']
304
316
305
317
# ...
318
+
319
+ # Global resources defaults, see in the next section.
320
+ defaults :
321
+ # ...
322
+ ```
323
+
324
+ ## Global Resources Defaults
325
+
326
+ If you need to globally configure all the resources instead of adding configuration in each one, it's possible to do so with the ` defaults ` key:
327
+
328
+ ``` yaml
329
+ # api/config/packages/api_platform.yaml
330
+ api_platform :
331
+
332
+ defaults :
333
+ description : ~
334
+ iri : ~
335
+ short_name : ~
336
+ item_operations : ~
337
+ collection_operations : ~
338
+
339
+ graphql : ~
340
+
341
+ elasticsearch : ~
342
+
343
+ security : ~
344
+ security_message : ~
345
+ security_post_denormalize : ~
346
+ security_post_denormalize_message : ~
347
+
348
+ cache_headers :
349
+ # Automatically generate etags for API responses.
350
+ etag : true
351
+
352
+ # Default value for the response max age.
353
+ max_age : 3600
354
+
355
+ # Default value for the response shared (proxy) max age.
356
+ shared_max_age : 3600
357
+
358
+ # Default values of the "Vary" HTTP header.
359
+ vary : ['Accept']
360
+
361
+ normalization_context : ~
362
+ denormalization_context : ~
363
+ swagger_context : ~
364
+ openapi_context : ~
365
+ deprecation_reason : ~
366
+ fetch_partial : ~
367
+ force_eager : ~
368
+ formats : ~
369
+ filters : ~
370
+ hydra_context : ~
371
+ mercure : ~
372
+ messenger : ~
373
+ order : ~
374
+
375
+ # To enable or disable pagination for all resource collections.
376
+ pagination_enabled : true
377
+
378
+ # To allow the client to enable or disable the pagination.
379
+ pagination_client_enabled : false
380
+
381
+ # To allow the client to set the number of items per page.
382
+ pagination_client_items_per_page : false
383
+
384
+ # To allow the client to enable or disable the partial pagination.
385
+ pagination_client_partial : false
386
+
387
+ # The default number of items per page.
388
+ pagination_items_per_page : 30
389
+
390
+ # The maximum number of items per page.
391
+ pagination_maximum_items_per_page : ~
392
+
393
+ # To allow partial pagination for all resource collections.
394
+ # This improves performances by skipping the `COUNT` query.
395
+ pagination_partial : false
396
+
397
+ # To use cursor-based pagination.
398
+ pagination_via_cursor : ~
399
+
400
+ pagination_fetch_join_collection : ~
401
+
402
+ route_prefix : ~
403
+ validation_groups : ~
404
+ sunset : ~
405
+ input : ~
406
+ output : ~
407
+ stateless : ~
408
+
409
+ # The URL generation strategy to use for IRIs
410
+ # Use values from UrlGeneratorInterface
411
+ url_generation_strategy : ~
412
+
413
+ # ...
306
414
```
0 commit comments