-
-
Notifications
You must be signed in to change notification settings - Fork 176
/
api_platform.yaml
76 lines (71 loc) · 2.66 KB
/
api_platform.yaml
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
api_platform:
title: API Platform's demo
version: 3.3.0
description: |
This is a demo application of the [API Platform](https://api-platform.com) framework.
[Its source code](https://github.com/api-platform/demo) includes various examples, check it out!
You may also be interested by [the GraphQL entrypoint](/graphql).
[A PWA](/) and [an admin](/admin) are consuming this API.
# Mercure integration, remove if unwanted
mercure:
include_type: true
graphql:
graphql_playground: false
formats:
jsonld: ['application/ld+json']
docs_formats:
jsonld: ['application/ld+json']
jsonopenapi: ['application/vnd.openapi+json']
html: ['text/html']
http_cache:
public: true
# Good defaults for REST APIs
defaults:
stateless: true
cache_headers:
vary: ['Content-Type', 'Authorization', 'Origin']
extra_properties:
standard_put: true
rfc_7807_compliant_errors: true
event_listeners_backward_compatibility_layer: false
keep_legacy_inflector: false
oauth:
enabled: true
clientId: '%env(OIDC_SWAGGER_CLIENT_ID)%'
pkce: true
type: oauth2
flow: authorizationCode
tokenUrl: '%env(OIDC_SERVER_URL)%/protocol/openid-connect/token'
authorizationUrl: '%env(OIDC_SERVER_URL)%/protocol/openid-connect/auth'
scopes:
openid: (required) Indicates that the application intends to use OIDC to verify the user's identity
services:
_defaults:
autowire: false
autoconfigure: false
public: false
app.filter.review.admin.user:
parent: 'api_platform.doctrine.orm.search_filter'
arguments:
$properties: { user: 'exact' } ]
tags: [ 'api_platform.filter' ]
app.filter.review.admin.book:
parent: 'api_platform.doctrine.orm.search_filter'
arguments:
$properties: { book: 'exact' } ]
tags: [ 'api_platform.filter' ]
app.filter.review.admin.rating:
parent: 'api_platform.doctrine.orm.numeric_filter'
arguments:
$properties: { rating: ~ } ]
tags: [ 'api_platform.filter' ]
# "name" is not a property, it's only a method "getName"
# Can't apply ApiFilter PHP attribute on method, so declare filter manually
app.filter.user.admin.name:
class: 'App\Doctrine\Orm\Filter\NameFilter'
arguments:
$managerRegistry: '@doctrine'
$logger: '@logger'
$nameConverter: '@?api_platform.name_converter'
$properties: { name: 'ipartial' } ]
tags: [ 'api_platform.filter' ]