Skip to content

Commit e1e18d4

Browse files
committed
Merge branch '2.5'
* 2.5: Bump versions of Swagger UI, GraphiQL and GraphQL Playground and improve contrib instructions Update changelog Fix a bug preventing to serialize validator's payload (#3375) Ignore FOSUser deprecations only Fix tests (#3506) Stop suggestion FOSUser, it harms more than it helps Changelog for 2.5.5
2 parents 887d707 + fa9d8ca commit e1e18d4

23 files changed

+1952
-1584
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2008,7 +2008,7 @@ jobs:
20082008
fail-fast: false
20092009
timeout-minutes: 20
20102010
env:
2011-
SYMFONY_DEPRECATIONS_HELPER: max[total]=8 # 5 deprecation notices from FOSUserBundle
2011+
SYMFONY_DEPRECATIONS_HELPER: max[total]=5
20122012
steps:
20132013
- name: Checkout
20142014
uses: actions/checkout@v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
/swagger.json
1010
/swagger.yaml
1111
/tests/Fixtures/app/var/
12+
/tests/Fixtures/app/public/bundles/
1213
/vendor/

CHANGELOG.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,34 @@
1010
* OpenAPI: Add PHP default values to the documentation (#2386)
1111
* Deprecate using a validation groups generator service not implementing `ApiPlatform\Core\Bridge\Symfony\Validator\ValidationGroupsGeneratorInterface` (#3346)
1212

13-
## 2.5.x-dev
14-
15-
* GraphQL: Do not allow empty cursor values on `before` or `after`
16-
* Filter: Improve the RangeFilter query in case the values are equals using the between operator
13+
## 2.5.5
14+
15+
* Filter: Improve the RangeFilter query in case the values are equals using the between operator #3488
16+
* Pagination: Fix bug with large values #3451
17+
* Doctrine: use the correct type within `setParameter` of the SearchFilter #3331
18+
* Allow `\Traversable` resources #3463
19+
* Hydra: `hydra:writable` => `hydra:writeable` #3481
20+
* Hydra: Show `hydra:next` only when it's available #3457
21+
* Swagger UI: Missing default context argument #3443
22+
* Swagger UI: Fix API docs path in swagger ui #3475
23+
* OpenAPI: Export with unescaped slashes #3368
24+
* OpenAPI: OAuth flows fix #3333
25+
* JSON Schema: Fix metadata options #3425
26+
* JSON Schema: Allow decoration #3417
27+
* JSON Schema: Add DateInterval type #3351
28+
* JSON Schema: Correct schema generation for many types #3402
29+
* Validation: Use API Platform's `ValidationException` instead of Symfony's #3414
30+
* Validation: Fix a bug preventing to serialize validator's payload #3375
31+
* Subresources: Improve queries when there's only one level #3396
32+
* HTTP: Location header is only set on POST with a 201 or between 300 and 400 #3497
33+
* GraphQL: Do not allow empty cursor values on `before` or `after` #3360
34+
* Bump versions of Swagger UI, GraphiQL and GraphQL Playground #3510
35+
>>>>>>> 2.5
1736
1837
## 2.5.4
1938

2039
* Add a local cache in `ResourceClassResolver::getResourceClass()`
21-
* JSON Schema: Fix generation for non-resource class
40+
* JSON Schema: Fix generation for non-resource class
2241
* Doctrine: Get class metadata only when it's needed in `SearchFilter`
2342
* GraphQL: Better detection of collection type
2443

CONTRIBUTING.md

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,29 @@ Then, if it appears that it's a real bug, you may report it using GitHub by foll
2525
First of all, you must decide on what branch your changes will be based depending of the nature of the change.
2626
See [the dedicated documentation entry](https://api-platform.com/docs/extra/releases/).
2727

28+
To prepare your patch directly in the `vendor/` of an existing project (convenient to fix a bug):
29+
30+
1. Remove the existing copy of the library: `rm -Rf vendor/api-platform/core`
31+
2. Reinstall the lib while keeping Git metadata: `composer install --prefer-source`
32+
3. You can now work directly in `vendor/api-platform/core`, create a new branch: `git checkout -b my_patch`
33+
4. When your patch is ready, fork the project and add your Git remote: `git remote add <your-name> [email protected]:<your-name>/core.git`
34+
5. You can now push your code and open your Pull Request: `git push <your-name> my_patch`
35+
36+
Alternatively, you can also work with the test application we provide:
37+
38+
cd tests/Fixtures/app
39+
./console assets:install --symlink
40+
symfony serve
41+
42+
# or if you prefer using the PHP built-in web server
43+
php -S localhost:8000 -t public/
44+
2845
### Matching Coding Standards
2946

3047
The API Platform project follows [Symfony coding standards](https://symfony.com/doc/current/contributing/code/standards.html).
3148
But don't worry, you can fix CS issues automatically using the [PHP CS Fixer](https://cs.sensiolabs.org/) tool:
3249

33-
```shell
34-
php-cs-fixer.phar fix
35-
```
50+
php-cs-fixer.phar fix
3651

3752
And then, add the fixed file to your commit before pushing.
3853
Be sure to add only **your modified files**. If any other file is fixed by cs tools, just revert it before committing.
@@ -59,45 +74,33 @@ Both `phpunit` and `behat` are development dependencies and should be available
5974

6075
To launch unit tests:
6176

62-
```shell
63-
vendor/bin/phpunit --stop-on-failure -vvv
64-
```
77+
vendor/bin/phpunit --stop-on-failure -vvv
6578

66-
If you want coverage, you will need the `phpdbg` package and run:
79+
If you want coverage, you will need the `pcov` PHP extension and run:
6780

68-
```shell
69-
phpdbg -qrr vendor/bin/phpunit --coverage-html coverage -vvv --stop-on-failure
70-
```
81+
vendor/bin/phpunit --coverage-html coverage -vvv --stop-on-failure
7182

7283
Sometimes there might be an error with too many open files when generating coverage. To fix this, you can increase the `ulimit`, for example:
7384

74-
```shell
75-
ulimit -n 4000
76-
```
85+
ulimit -n 4000
7786

7887
Coverage will be available in `coverage/index.html`.
7988

8089
#### Behat
8190

8291
The command to launch Behat tests is:
8392

84-
```shell
85-
./vendor/bin/behat --suite=default --stop-on-failure -vvv
86-
```
93+
./vendor/bin/behat --suite=default --stop-on-failure -vvv
8794

8895
If you want to launch Behat tests for MongoDB, the command is:
8996

90-
```shell
91-
APP_ENV=mongodb ./vendor/bin/behat --suite=mongodb --stop-on-failure -vvv
92-
```
97+
APP_ENV=mongodb ./vendor/bin/behat --suite=mongodb --stop-on-failure -vvv
9398

9499
## Squash your Commits
95100

96101
If you have 3 commits, start with:
97102

98-
```shell
99-
git rebase -i HEAD~3
100-
```
103+
git rebase -i HEAD~3
101104

102105
An editor will be opened with your 3 commits, all prefixed by `pick`.
103106

@@ -109,15 +112,11 @@ After that, all your commits will be squashed into the first one and the commit
109112

110113
If you would like to rename your commit message, type:
111114

112-
```shell
113-
git commit --amend
114-
```
115+
git commit --amend
115116

116117
Now force push to update your PR:
117118

118-
```shell
119-
git push --force-with-lease
120-
```
119+
git push --force-with-lease
121120

122121
# License and Copyright Attribution
123122

@@ -127,3 +126,13 @@ and to transfer the copyright on the submitted code to Kévin Dunglas.
127126
Be sure to you have the right to do that (if you are a professional, ask your company)!
128127

129128
If you include code from another project, please mention it in the Pull Request description and credit the original author.
129+
130+
# Releases
131+
132+
This section is dedicated to maintainers.
133+
134+
1. Update the JavaScript dependencies by running `./update-js.sh` (always check if it works in a browser)
135+
2. Update the `CHANGELOG.md` file (be sure to include Pull Request numbers when appropriate)
136+
3. Create a signed tag: `git tag -s vX.Y.Z -m "Version X.Y.Z"`
137+
4. Create a release using GitHub's UI and copy the changelog
138+
5. Create a new release of `api-platform/api-platform`

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"doctrine/mongodb-odm-bundle": "^4.0",
4343
"doctrine/orm": "^2.6.4",
4444
"elasticsearch/elasticsearch": "^6.0",
45-
"friendsofsymfony/user-bundle": "^2.2@dev",
45+
"friendsofsymfony/user-bundle": "2.2.x-dev#157b53bd7d6c347148a90e723981a43f9c897bf5",
4646
"guzzlehttp/guzzle": "^6.0",
4747
"jangregor/phpstan-prophecy": "^0.6",
4848
"justinrainbow/json-schema": "^5.2.1",
@@ -97,7 +97,6 @@
9797
"suggest": {
9898
"doctrine/mongodb-odm-bundle": "To support MongoDB. Only versions 4.0 and later are supported.",
9999
"elasticsearch/elasticsearch": "To support Elasticsearch.",
100-
"friendsofsymfony/user-bundle": "To use the FOSUserBundle bridge.",
101100
"guzzlehttp/guzzle": "To use the HTTP cache invalidation system.",
102101
"phpdocumentor/reflection-docblock": "To support extracting metadata from PHPDoc.",
103102
"psr/cache-implementation": "To use metadata caching.",

src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function getConfigTreeBuilder()
9696
->arrayNode('validator')
9797
->addDefaultsIfNotSet()
9898
->children()
99-
->variableNode('serialize_payload_fields')->defaultValue([])->info('Enable the serialization of payload fields when a validation error is thrown.')->end()
99+
->variableNode('serialize_payload_fields')->defaultValue([])->info('Set to null to serialize all payload fields when a validation error is thrown, or set the fields you want to include explicitly.')->end()
100100
->end()
101101
->end()
102102
->arrayNode('eager_loading')

0 commit comments

Comments
 (0)