Skip to content

Commit 744130c

Browse files
docs(fosrestbundle): move from core to symfony and update (#2100)
1 parent 041b4c5 commit 744130c

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

core/getting-started.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ You can choose your preferred stack between Symfony, Laravel, or bootstrapping t
1111

1212
If you are starting a new project, the easiest way to get API Platform up is to install [API Platform for Symfony](../symfony/index.md).
1313

14-
It comes with the API Platform core library integrated with [the Symfony framework](https://symfony.com), [the schema generator](../schema-generator/),
14+
It comes with the API Platform core library integrated with [the Symfony framework](https://symfony.com), [the schema generator](../schema-generator/index.md),
1515
[Doctrine ORM](https://www.doctrine-project.org),
16-
[NelmioCorsBundle](https://github.com/nelmio/NelmioCorsBundle) and [test assertions dedicated to APIs](../symfony/testing-utilities.md).
16+
[NelmioCorsBundle](https://github.com/nelmio/NelmioCorsBundle) and [test assertions dedicated to APIs](../symfony/testing.md).
1717

1818
[MongoDB](mongodb.md) and [Elasticsearch](elasticsearch.md) can also be easily enabled.
1919

@@ -30,7 +30,8 @@ There are no mandatory configuration options although [many settings are availab
3030

3131
### Migrating from FOSRestBundle
3232

33-
If you plan to migrate from FOSRestBundle, you might want to read [this guide](migrate-from-fosrestbundle.md) to get started with API Platform.
33+
If you plan to migrate from FOSRestBundle, you might want to read [this guide](../symfony/migrate-from-fosrestbundle.md)
34+
to get started with API Platform.
3435

3536
### Laravel
3637

outline.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ chapters:
99
- testing
1010
- debugging
1111
- caddy
12+
- migrate-from-fosrestbundle
1213
- title: "API Platform for Laravel"
1314
path: laravel
1415
items:
@@ -68,7 +69,6 @@ chapters:
6869
- nelmio-api-doc
6970
- bootstrap
7071
- configuration
71-
- migrate-from-fosrestbundle
7272
- title: Schema Generator
7373
path: schema-generator
7474
items:

core/migrate-from-fosrestbundle.md renamed to symfony/migrate-from-fosrestbundle.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
# Migrate From FOSRestBundle
1+
# Migrate From FOSRestBundle with Symfony
22

33
[FOSRestBundle](https://github.com/FriendsOfSymfony/FOSRestBundle) is a popular bundle to rapidly develop RESTful APIs with Symfony.
44
This page provides a guide to help developers migrate from FOSRestBundle to API Platform.
55

6-
[On 21 September 2021](https://x.com/lsmith/status/1440216817876627459), FOSRestBundle's creators recommended to use API Platform.
6+
> [!IMPORTANT]
7+
> Since [2021](https://x.com/lsmith/status/1440216817876627459), the creators of FOSRestBundle have recommended
8+
> transitioning to **API Platform** as the preferred solution **for building modern APIs**.
79
810
## Features Comparison
911

@@ -21,7 +23,7 @@ See [The view layer](https://github.com/FriendsOfSymfony/FOSRestBundle/blob/3.x/
2123

2224
Add the `ApiResource` attribute to your entities, and enable the operations you desire inside. By default, every operation is activated.
2325

24-
See [Operations](operations.md).
26+
See [Operations](../core/operations.md).
2527

2628
### Make custom controllers
2729

@@ -31,11 +33,11 @@ Same as above.
3133

3234
**In API Platform**
3335

34-
Even though this is not recommended, API Platform allows you to [create custom controllers](controllers.md) and declare them in your entity's `ApiResource` attribute.
36+
Even though this is not recommended, API Platform allows you to [create custom controllers](../core/controllers.md) and declare them in your entity's `ApiResource` attribute.
3537

36-
You can use them as you migrate from FOSRestBundle, but you should consider [switching to Symfony Messenger](messenger.md) as it will give you more benefits, such as compatibility with both REST and GraphQL and better performances of your API on big tasks.
38+
You can use them as you migrate from FOSRestBundle, but you should consider [switching to Symfony Messenger](../core/messenger.md) as it will give you more benefits, such as compatibility with both REST and GraphQL and better performances of your API on big tasks.
3739

38-
See [General Design Considerations](design.md).
40+
See [General Design Considerations](../core/design.md).
3941

4042
### Routing system (with native documentation support)
4143

@@ -49,7 +51,7 @@ See [Full default annotations](https://github.com/FriendsOfSymfony/FOSRestBundle
4951

5052
Use the `ApiResource` attribute to activate the HTTP methods you need for your entity. By default, all the methods are enabled.
5153

52-
See [Operations](operations.md).
54+
See [Operations](../core/operations.md).
5355

5456
### Hook into the handling of the requests
5557

@@ -63,7 +65,7 @@ See [Listener support](https://github.com/FriendsOfSymfony/FOSRestBundle/blob/3.
6365

6466
API Platform provides a lot of ways to customize the behavior of your API, depending on what you exactly want to do.
6567

66-
See [Extending API Platform](extending.md) for more details.
68+
See [Extending API Platform](../core/extending.md) for more details.
6769

6870
### Customize the formats of the requests and the responses
6971

@@ -81,7 +83,7 @@ Both the request and the response body's format can be customized.
8183

8284
You can configure the formats of the API either globally or in specific resources or operations. API Platform provides native support for multiple formats including JSON, XML, CSV, YAML, etc.
8385

84-
See [Content negotiation](content-negotiation.md).
86+
See [Content negotiation](../core/content-negotiation.md).
8587

8688
### Name conversion
8789

@@ -99,7 +101,7 @@ Both request and response bodies can be converted.
99101

100102
API Platform uses [name converters](https://symfony.com/doc/current/components/serializer.html#component-serializer-converting-property-names-when-serializing-and-deserializing) included in the Serializer component of Symfony. You can create your own by implementing the `NameConverterInterface` provided by Symfony.
101103

102-
See [_Name Conversion_ in The Serialization Process](serialization.md#name-conversion).
104+
See [_Name Conversion_ in The Serialization Process](../core/serialization.md#name-conversion-for-symfony).
103105

104106
### Handle errors
105107

@@ -113,7 +115,7 @@ See [ExceptionController support](https://github.com/FriendsOfSymfony/FOSRestBun
113115

114116
Map the exceptions to HTTP statuses in the `api_platform.exception_to_status` parameter.
115117

116-
See [Errors Handling](errors.md).
118+
See [Errors Handling](../core/errors.md).
117119

118120
### Security
119121

@@ -127,7 +129,7 @@ Use the `security` attribute in the `ApiResource` and `ApiProperty` attributes.
127129

128130
Note you can also use the `security.yml` file if you only need to limit access to specific roles.
129131

130-
See [Security](security.md).
132+
See [Security](../core/security.md).
131133

132134
### API versioning
133135

@@ -141,4 +143,4 @@ See [API versioning](https://github.com/FriendsOfSymfony/FOSRestBundle/blob/3.x/
141143

142144
API Platform has no native support for API versioning, but instead provides an approach consisting of deprecating resources when needed. It allows a smoother upgrade for clients, as they need to change their code only when it is necessary.
143145

144-
See [Deprecating Resources and Properties](deprecations.md).
146+
See [Deprecating Resources and Properties](../core/deprecations.md).

0 commit comments

Comments
 (0)