You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[YAML](http://yaml.org/) | `yaml` | `application/x-yaml` | no
27
+
[YAML](https://yaml.org/) | `yaml` | `application/x-yaml` | no
28
28
[CSV](https://tools.ietf.org/html/rfc4180) | `csv` | `text/csv` | no
29
29
[HTML](https://whatwg.org/) (API docs) | `html` | `text/html` | no
30
30
[XML](https://www.w3.org/XML/) | `xml` | `application/xml`, `text/xml` | no
@@ -119,7 +119,7 @@ Additionally the `csv` format is added with the MIME type `text/csv`.
119
119
It is also important to notice that the usage of this attribute will override the formats defined in the configuration, therefore
120
120
this configuration might disable the `json` or the `html` on this resource for example.
121
121
122
-
You can specify different accepted formats at operation level too, it's especially convenient for to configure formats available for the `PATCH` method:
122
+
You can specify different accepted formats at operation level too, it's especially convenient to configure formats available for the `PATCH` method:
123
123
124
124
[codeSelector]
125
125
@@ -183,7 +183,7 @@ resources:
183
183
## Supporting Custom Formats
184
184
185
185
The API Platform content negotiation system is extendable.
186
-
You can add support for formats not available by default by creating custom normalizer and encoders.
186
+
You can add support for formats not available by default by creating custom normalizers and encoders.
187
187
Refer to the Symfony documentation to learn [how to create and register such classes](https://symfony.com/doc/current/serializer.html#adding-normalizers-and-encoders).
188
188
189
189
Then, register the new format in the configuration:
Copy file name to clipboardExpand all lines: core/controllers.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Note: using custom controllers with API Platform is **discouraged**. Also, Graph
4
4
[For most use cases, better extension points, working both with REST and GraphQL, are available](design.md).
5
5
6
6
API Platform can leverage the Symfony routing system to register custom operations related to custom controllers. Such custom
7
-
controllers can be any valid [Symfony controller](http://symfony.com/doc/current/book/controller.html), including standard
7
+
controllers can be any valid [Symfony controller](https://symfony.com/doc/current/controller.html), including standard
8
8
Symfony controllers extending the [`Symfony\Bundle\FrameworkBundle\Controller\AbstractController`](http://api.symfony.com/4.1/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.html)
9
9
helper class.
10
10
@@ -15,7 +15,7 @@ implements the [Action-Domain-Responder](https://github.com/pmjones/adr) pattern
15
15
The distribution of API Platform also eases the implementation of the ADR pattern: it automatically registers action classes
16
16
stored in `api/src/Controller` as autowired services.
17
17
18
-
Thanks to the [autowiring](http://symfony.com/doc/current/components/dependency_injection/autowiring.html) feature of the
18
+
Thanks to the [autowiring](https://symfony.com/doc/current/service_container/autowiring.html) feature of the
19
19
Symfony Dependency Injection container, services required by an action can be type-hinted in its constructor, it will be
20
20
automatically instantiated and injected, without having to declare it explicitly.
21
21
@@ -433,7 +433,7 @@ resources:
433
433
[/codeSelector]
434
434
435
435
API Platform will automatically map this `post_publication` operation to the route `book_post_publication`. Let's create a custom action
Copy file name to clipboardExpand all lines: core/extending.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Extending API Platform
2
2
3
-
Because it handles the complex, tedious and repetitive task of creating an API infrastructure for you, API Platform lets you focus on what matter the most for the end user: the business logic.
3
+
Because it handles the complex, tedious and repetitive task of creating an API infrastructure for you, API Platform lets you focus on what matters the most for the end user: the business logic.
4
4
To do so, API Platform provides a lot of extension points you can use to hook your own code.
5
5
Those extensions points are taken into account both by the REST and [GraphQL](graphql.md) subsystems.
Copy file name to clipboardExpand all lines: core/external-vocabularies.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
# Using External Vocabularies
2
2
3
3
JSON-LD allows to define classes and properties of your API with open vocabularies such as [Schema.org](https://schema.org)
4
-
and [Good Relations](http://www.heppnetz.de/projects/goodrelations/).
4
+
and [Good Relations](https://www.heppnetz.de/projects/goodrelations/).
5
5
6
-
API Platform provides annotations usable on PHP classes and properties for specifying a related external [IRI](https://en.wikipedia.org/wiki/Internationalized_resource_identifier).
6
+
API Platform provides attributes usable on PHP classes and properties for specifying a related external [IRI](https://en.wikipedia.org/wiki/Internationalized_resource_identifier).
7
7
8
8
```php
9
9
<?php
@@ -25,7 +25,7 @@ class Book
25
25
}
26
26
```
27
27
28
-
The generated JSON for products and the related context document will now use external IRIs according to the specified annotations:
28
+
The generated JSON for products and the related context document will now use external IRIs according to the specified attributes:
29
29
30
30
`GET /books/22`
31
31
@@ -50,9 +50,9 @@ The generated JSON for products and the related context document will now use ex
50
50
}
51
51
```
52
52
53
-
An extended list of existing open vocabularies is available on [the Linked Open Vocabularies (LOV) database](http://lov.okfn.org/dataset/lov/).
53
+
An extended list of existing open vocabularies is available on [the Linked Open Vocabularies (LOV) database](https://lov.linkeddata.es/dataset/lov/).
54
54
55
-
By default, when using [validations](validation.md) API Platform will try to define known [Schema.org](https://schema.org) types as IRIs for your properties if you did not provide any in your `#[ApiProperty]`annotations.
55
+
By default, when using [validations](validation.md) API Platform will try to define known [Schema.org](https://schema.org) types as IRIs for your properties if you did not provide any in your `#[ApiProperty]`attributes.
Copy file name to clipboardExpand all lines: core/filters.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ by the library.
9
9
10
10
By default, all filters are disabled. They must be enabled explicitly.
11
11
12
-
When a filter is enabled, it automatically appears in the [OpenAPI](swagger.md) and [GraphQL](graphql.md) documentations.
12
+
When a filter is enabled, it automatically appears in the [OpenAPI](openapi.md) and [GraphQL](graphql.md) documentations.
13
13
It is also automatically documented as a `hydra:search` property for JSON-LD responses.
14
14
15
15
<palign="center"class="symfonycasts"><ahref="https://symfonycasts.com/screencast/api-platform/filters?cid=apip"><imgsrc="../distribution/images/symfonycasts-player.png"alt="Filtering and Searching screencast"><br>Watch the Filtering & Searching screencast</a>
@@ -1416,10 +1416,10 @@ class AndOperatorFilterExtension implements RequestBodySearchCollectionExtension
1416
1416
1417
1417
### Using Doctrine ORM Filters
1418
1418
1419
-
Doctrine ORM features [a filter system](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/filters.html) that allows the developer to add SQL to the conditional clauses of queries, regardless of the place where the SQL is generated (e.g. from a DQL query, or by loading associated entities).
1419
+
Doctrine ORM features [a filter system](https://www.doctrine-project.org/projects/doctrine-orm/en/latest/reference/filters.html) that allows the developer to add SQL to the conditional clauses of queries, regardless of the place where the SQL is generated (e.g. from a DQL query, or by loading associated entities).
1420
1420
These are applied to collections and items and therefore are incredibly useful.
1421
1421
1422
-
The following information, specific to Doctrine filters in Symfony, is based upon [a great article posted on Michaël Perrin's blog](http://blog.michaelperrin.fr/2014/12/05/doctrine-filters/).
1422
+
The following information, specific to Doctrine filters in Symfony, is based upon [a great article posted on Michaël Perrin's blog](https://www.michaelperrin.fr/blog/2014/12/doctrine-filters).
1423
1423
1424
1424
Suppose we have a `User` entity and an `Order` entity related to the `User` one. A user should only see his orders and no one else's.
Copy file name to clipboardExpand all lines: core/getting-started.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@ If you plan to migrate from FOSRestBundle, you might want to read [this guide](m
9
9
If you are starting a new project, the easiest way to get API Platform up is to install the [API Platform Distribution](../distribution/index.md).
10
10
It comes with the API Platform core library integrated with [the Symfony framework](https://symfony.com), [the schema generator](../schema-generator/),
[NelmioCorsBundle](https://github.com/nelmio/NelmioCorsBundle) and [Behat](http://behat.org).
12
+
[NelmioCorsBundle](https://github.com/nelmio/NelmioCorsBundle) and [Behat](https://behat.org/).
13
13
[Doctrine MongoDB ODM](https://www.doctrine-project.org/projects/mongodb-odm.html) can also be enabled by following the [MongoDB documentation](mongodb.md).
14
14
Basically, it is a Symfony edition packaged with the best tools to develop a REST API and sensible default settings.
15
15
16
-
Alternatively, you can use [Composer](http://getcomposer.org) to install the standalone bundle in an existing Symfony Flex
16
+
Alternatively, you can use [Composer](https://getcomposer.org/) to install the standalone bundle in an existing Symfony Flex
17
17
project:
18
18
19
19
`composer require api`
@@ -26,17 +26,17 @@ There are no mandatory configuration options although [many settings are availab
26
26
27
27
If you haven't read it already, take a look at [the Getting Started guide](../distribution/index.md).
28
28
This tutorial covers basic concepts required to understand how API Platform works including how it implements the REST pattern
29
-
and what [JSON-LD](http://json-ld.org/) and [Hydra](http://www.hydra-cg.com/) formats are.
29
+
and what [JSON-LD](https://json-ld.org/) and [Hydra](https://www.hydra-cg.com/) formats are.
30
30
31
31
## Mapping the Entities
32
32
33
33
<palign="center"class="symfonycasts"><ahref="https://symfonycasts.com/screencast/api-platform/api-resource?cid=apip"><imgsrc="../distribution/images/symfonycasts-player.png"alt="Create an API Resource screencast"><br>Watch the Create an API Resource screencast</a></p>
34
34
35
35
API Platform is able to automatically expose entities mapped as "API resources" through a REST API supporting CRUD
36
36
operations.
37
-
To expose your entities, you can use Docblock annotations, XML and YAML configuration files.
37
+
To expose your entities, you can use attributes, XML and YAML configuration files.
38
38
39
-
Here is an example of entities mapped using annotations which will be exposed through a REST API:
39
+
Here is an example of entities mapped using attributes which will be exposed through a REST API:
40
40
41
41
```php
42
42
<?php
@@ -139,8 +139,8 @@ class Offer
139
139
It is the minimal configuration required to expose `Product` and `Offer` entities as JSON-LD documents through an hypermedia
140
140
web API.
141
141
142
-
If you are familiar with the Symfony ecosystem, you noticed that entity classes are also mapped with Doctrine ORM annotations
143
-
and validation constraints from [the Symfony Validator Component](http://symfony.com/doc/current/book/validation.html).
142
+
If you are familiar with the Symfony ecosystem, you noticed that entity classes are also mapped with Doctrine ORM attributes
143
+
and validation constraints from [the Symfony Validator Component](https://symfony.com/doc/current/validation.html).
144
144
This isn't mandatory. You can use [your preferred persistence](state-providers.md) and [validation](validation.md) systems.
145
145
However, API Platform has built-in support for those libraries and is able to use them without requiring any specific
146
146
code or configuration to automatically persist and validate your data. They are a good default option and we encourage you to use
@@ -164,7 +164,7 @@ The same operations are available for the offer method (routes will start with t
164
164
Route prefixes are built by pluralizing the name of the mapped entity class.
165
165
It is also possible to override the naming convention using [operation path namings](operation-path-naming.md).
166
166
167
-
As an alternative to annotations, you can map entity classes using YAML or XML:
167
+
As an alternative to attributes, you can map entity classes using YAML or XML:
168
168
169
169
[codeSelector]
170
170
@@ -202,14 +202,14 @@ resources:
202
202
203
203
[/codeSelector]
204
204
205
-
If you prefer to use YAML or XML files instead of annotations, you must configure API Platform to load the appropriate files:
205
+
If you prefer to use YAML or XML files instead of attributes, you must configure API Platform to load the appropriate files:
206
206
207
207
```yaml
208
208
# api/config/packages/api_platform.yaml
209
209
api_platform:
210
210
mapping:
211
211
paths:
212
-
- '%kernel.project_dir%/src/Entity'# default configuration for annotations
212
+
- '%kernel.project_dir%/src/Entity'# default configuration for attributes
213
213
- '%kernel.project_dir%/config/api_platform'# yaml or xml directory configuration
214
214
```
215
215
@@ -220,6 +220,6 @@ If you want to serialize only a subset of your data, please refer to the [Serial
220
220
You now have a fully featured API exposing your entities.
221
221
Run the Symfony app with the [Symfony Local Web Server](https://symfony.com/doc/current/setup/symfony_server.html) (`symfony server:start`) and browse the API entrypoint at `http://localhost:8000/api`.
222
222
223
-
Interact with the API using a REST client (we recommend [Postman](https://www.getpostman.com/)) or an Hydra-aware application
223
+
Interact with the API using a REST client (we recommend [Postman](https://www.postman.com/)) or an Hydra-aware application
224
224
(you should give [Hydra Console](https://github.com/lanthaler/HydraConsole) a try). Take
225
225
a look at the usage examples in [the `features` directory](https://github.com/api-platform/core/tree/main/features).
0 commit comments