Skip to content

Commit d85ed0c

Browse files
committed
Merge 3.2
2 parents ddc3b1c + f297d21 commit d85ed0c

File tree

74 files changed

+1111
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1111
-173
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ jobs:
8787
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
8888
restore-keys: ${{ runner.os }}-composer-
8989
- name: Update project dependencies
90-
run: composer update --no-interaction --no-progress --ansi
90+
run: |
91+
composer update --no-interaction --no-progress --ansi
9192
- name: Install PHPUnit
9293
run: vendor/bin/simple-phpunit --version
9394
- name: Cache PHPStan results
@@ -456,6 +457,7 @@ jobs:
456457
- name: Update project dependencies
457458
run: |
458459
composer update --no-interaction --no-progress --ansi
460+
composer require --dev doctrine/mongodb-odm-bundle
459461
- name: Install PHPUnit
460462
run: vendor/bin/simple-phpunit --version
461463
- name: Clear test app cache

CHANGELOG.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# Changelog
22

3+
## v3.2.7
4+
5+
Symfony 7 support.
6+
7+
### Bug fixes
8+
9+
* [183b4d637](https://github.com/api-platform/core/commit/183b4d6374a66ffaf33b3341b757a832d5a39799) fix(symfony): named arguments dependency injection
10+
* [3d32d5e12](https://github.com/api-platform/core/commit/3d32d5e12b1d93be72064e12979402487aa3e49a) fix(openapi): entrypoint access vnd+openapi (#6012)
11+
* [58f4a3dda](https://github.com/api-platform/core/commit/58f4a3dda820a0b61c7361f76a789f1560d8f8ab) fix: no boolean types for exclusive minimum and exclusive maximum open api (#5993)
12+
* [5e8f5eb99](https://github.com/api-platform/core/commit/5e8f5eb99152a8914b725ffe3f4beea72ce6e5b6) fix(graphql): consider writable flag also for nested input types (#5954)
13+
* [9848bd4d4](https://github.com/api-platform/core/commit/9848bd4d4917a97000119ee98a09916af469acd8) fix: missing eager joins on to-one relationships (#5992)
14+
* [aa44dd726](https://github.com/api-platform/core/commit/aa44dd7264e6264ec3ec569f9f4be081927a67cb) fix(openapi): max cardinality
15+
* [c2be40994](https://github.com/api-platform/core/commit/c2be40994ec08b51bf23b4b807eb3d4f984379ff) fix(symfony): error in provider without uri variables (#6005)
16+
* [d2f281eed](https://github.com/api-platform/core/commit/d2f281eedbd87a3c1a3377bb23a229e1b17a0f45) fix(jsonschema): fix recursive documentation when using a dto entity wrapper (#5973)
17+
* [e7bc2ab57](https://github.com/api-platform/core/commit/e7bc2ab5770fe673093596bc217516be61d582fc) fix(jsonschema): indirect resource input schema (#6001)
18+
19+
## v3.2.6
20+
21+
### Bug fixes
22+
23+
To have errors backward compatible with 3.1, use:
24+
25+
```yaml
26+
api_platform:
27+
defaults:
28+
extra_properties:
29+
rfc_7807_compliant_errors: false
30+
```
31+
32+
New extension points are available using [Errors](https://api-platform.com/docs/v3.2/core/errors/) with `rfc_7807_compliant_errors: true` such as [Error provider](https://api-platform.com/docs/v3.2/guides/error-provider/) and [Error Resource](https://api-platform.com/docs/v3.2/guides/error-resource/)
33+
34+
* [1b4289412](https://github.com/api-platform/core/commit/1b42894128545ad72b19b6be1c31ad25351c9138) fix: errors bc with rfc_7807_compliant_errors false (#5974)
35+
* [ce297e6f7](https://github.com/api-platform/core/commit/ce297e6f73e1797ede21312aa31af2b110e9e583) fix(jsonschema): child entity property schema generation (#5988) (#5989)
36+
337
## v3.2.5
438

539
### Bug fixes
@@ -1911,4 +1945,4 @@ Please read #2825 if you have issues with the behavior of Readable/Writable Link
19111945
## 1.0.0 beta 2
19121946

19131947
* Preserve indexes when normalizing and denormalizing associative arrays
1914-
* Allow setting default order for property when registering a `Doctrine\Orm\Filter\OrderFilter` instance
1948+
* Allow setting default order for property when registering a `Doctrine\Orm\Filter\OrderFilter` instance

composer.json

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
"psr/cache": "^1.0 || ^2.0 || ^3.0",
1919
"psr/container": "^1.0 || ^2.0",
2020
"symfony/deprecation-contracts": "^3.1",
21-
"symfony/http-foundation": "^6.1",
22-
"symfony/http-kernel": "^6.1",
23-
"symfony/property-access": "^6.1",
24-
"symfony/property-info": "^6.1",
25-
"symfony/serializer": "^6.1",
21+
"symfony/http-foundation": "^6.1 || ^7.0",
22+
"symfony/http-kernel": "^6.1 || ^7.0",
23+
"symfony/property-access": "^6.1 || ^7.0",
24+
"symfony/property-info": "^6.1 || ^7.0",
25+
"symfony/serializer": "^6.1 || ^7.0",
2626
"symfony/translation-contracts": "^3.3",
27-
"symfony/web-link": "^6.1",
27+
"symfony/web-link": "^6.1 || ^7.0",
2828
"willdurand/negotiation": "^3.0"
2929
},
3030
"require-dev": {
@@ -35,7 +35,6 @@
3535
"doctrine/dbal": "^3.4.0",
3636
"doctrine/doctrine-bundle": "^1.12 || ^2.0",
3737
"doctrine/mongodb-odm": "^2.2",
38-
"doctrine/mongodb-odm-bundle": "^4.0",
3938
"doctrine/orm": "^2.14",
4039
"elasticsearch/elasticsearch": "^7.11 || ^8.4",
4140
"friends-of-behat/mink-browserkit-driver": "^1.3.1",
@@ -56,36 +55,36 @@
5655
"ramsey/uuid-doctrine": "^1.4 || ^2.0",
5756
"soyuka/contexts": "v3.3.9",
5857
"soyuka/stubs-mongodb": "^1.0",
59-
"symfony/asset": "^6.1",
60-
"symfony/browser-kit": "^6.1",
61-
"symfony/cache": "^6.1",
62-
"symfony/config": "^6.1",
63-
"symfony/console": "^6.1",
64-
"symfony/css-selector": "^6.1",
65-
"symfony/dependency-injection": "^6.1.12",
66-
"symfony/doctrine-bridge": "^6.1",
67-
"symfony/dom-crawler": "^6.1",
68-
"symfony/error-handler": "^6.1",
69-
"symfony/event-dispatcher": "^6.1",
70-
"symfony/expression-language": "^6.1",
71-
"symfony/finder": "^6.1",
72-
"symfony/form": "^6.1",
73-
"symfony/framework-bundle": "^6.1",
74-
"symfony/http-client": "^6.1",
75-
"symfony/intl": "^6.1",
58+
"symfony/asset": "^6.1 || ^7.0",
59+
"symfony/browser-kit": "^6.1 || ^7.0",
60+
"symfony/cache": "^6.1 || ^7.0",
61+
"symfony/config": "^6.1 || ^7.0",
62+
"symfony/console": "^6.1 || ^7.0",
63+
"symfony/css-selector": "^6.1 || ^7.0",
64+
"symfony/dependency-injection": "^6.1 || ^7.0.12",
65+
"symfony/doctrine-bridge": "^6.1 || ^7.0",
66+
"symfony/dom-crawler": "^6.1 || ^7.0",
67+
"symfony/error-handler": "^6.1 || ^7.0",
68+
"symfony/event-dispatcher": "^6.1 || ^7.0",
69+
"symfony/expression-language": "^6.1 || ^7.0",
70+
"symfony/finder": "^6.1 || ^7.0",
71+
"symfony/form": "^6.1 || ^7.0",
72+
"symfony/framework-bundle": "^6.1 || ^7.0",
73+
"symfony/http-client": "^6.1 || ^7.0",
74+
"symfony/intl": "^6.1 || ^7.0",
7675
"symfony/maker-bundle": "^1.24",
7776
"symfony/mercure-bundle": "*",
78-
"symfony/messenger": "^6.1",
79-
"symfony/phpunit-bridge": "^6.1",
80-
"symfony/routing": "^6.1",
81-
"symfony/security-bundle": "^6.1",
82-
"symfony/security-core": "^6.1",
83-
"symfony/stopwatch": "^6.1",
84-
"symfony/twig-bundle": "^6.1",
85-
"symfony/uid": "^6.1",
86-
"symfony/validator": "^6.1",
87-
"symfony/web-profiler-bundle": "^6.1",
88-
"symfony/yaml": "^6.1",
77+
"symfony/messenger": "^6.1 || ^7.0",
78+
"symfony/phpunit-bridge": "^6.1 || ^7.0",
79+
"symfony/routing": "^6.1 || ^7.0",
80+
"symfony/security-bundle": "^6.1 || ^7.0",
81+
"symfony/security-core": "^6.1 || ^7.0",
82+
"symfony/stopwatch": "^6.1 || ^7.0",
83+
"symfony/twig-bundle": "^6.1 || ^7.0",
84+
"symfony/uid": "^6.1 || ^7.0",
85+
"symfony/validator": "^6.1 || ^7.0",
86+
"symfony/web-profiler-bundle": "^6.1 || ^7.0",
87+
"symfony/yaml": "^6.1 || ^7.0",
8988
"twig/twig": "^1.42.3 || ^2.12 || ^3.0",
9089
"webonyx/graphql-php": "^14.0 || ^15.0"
9190
},
@@ -145,7 +144,7 @@
145144
"dev-main": "3.3.x-dev"
146145
},
147146
"symfony": {
148-
"require": "^6.1"
147+
"require": "^6.1 || ^7.0"
149148
}
150149
}
151150
}

docs/guides/declare-a-resource.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// tags: design
88
// ---
99

10-
// # Declare a Resource
1110
// This class represents an API resource
1211

1312
namespace App\ApiResource {

docs/guides/doctrine-entity-as-resource.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
// tags: doctrine
77
// executable: true
88
// ---
9-
10-
// # API Resource on a Doctrine Entity.
119
//
1210
// API Platform is compatible with [Doctrine ORM](https://www.doctrine-project.org), all we need is to declare an
1311

docs/guides/extend-openapi-documentation.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// tags: openapi, expert
88
// ---
99

10-
// # Extend OpenAPI Documentation
1110
namespace App\ApiResource {
1211
use ApiPlatform\Metadata\Post;
1312
use ApiPlatform\OpenApi\Model\Operation;

docs/guides/handle-links.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// executable: true
88
// ---
99

10-
// # Handle links
11-
//
1210
// When using subresources with doctrine, API Platform tries to handle your links,
1311
// and the algorithm sometimes overcomplicates SQL queries.
1412

docs/guides/hook-a-persistence-layer-with-a-processor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// tags: design
88
// ---
99

10-
// # Hook a Persistence Layer with a Processor
11-
1210
namespace App\ApiResource {
1311
use ApiPlatform\Metadata\ApiResource;
1412
use App\State\BookProcessor;

docs/guides/provide-the-resource-state.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// tags: design, state
88
// ---
99

10-
// # Provide the Resource State
1110
// Our model is the same then in the previous guide ([Declare a Resource](/playground/declare-a-resource). API Platform will declare
1211
// CRUD operations if we don't declare them.
1312

docs/guides/subresource.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// executable: true
88
// ---
99

10-
// # Subresource
11-
//
1210
// In API Platform, a subresource is an alternate way to reach a Resource.
1311

1412
namespace App\Entity {

docs/guides/validate-incoming-data.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// tags: validation
88
// ---
99

10-
// # Validing incoming data
1110
// When processing the incoming request, when creating or updating content, API-Platform will validate the
1211
// incoming content. It will use the [Symfony's validator](https://symfony.com/doc/current/validation.html).
1312
//

features/graphql/mutation.feature

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,79 @@ Feature: GraphQL mutation support
662662
And the JSON node "data.updateDummy.dummy.relatedDummies.edges[0].node.name" should be equal to "RelatedDummy11"
663663
And the JSON node "data.updateDummy.clientMutationId" should be equal to "myId"
664664

665+
@createSchema
666+
@!mongodb
667+
Scenario: Modify an item with embedded object through a mutation
668+
Given there is a fooDummy objects with fake names and embeddable
669+
When I send the following GraphQL request:
670+
"""
671+
mutation {
672+
updateFooDummy(input: {id: "/foo_dummies/1", name: "modifiedName", embeddedFoo: {dummyName: "Embedded name"}, clientMutationId: "myId"}) {
673+
fooDummy {
674+
id
675+
name
676+
embeddedFoo {
677+
dummyName
678+
}
679+
}
680+
clientMutationId
681+
}
682+
}
683+
"""
684+
Then the response status code should be 200
685+
And the response should be in JSON
686+
And the header "Content-Type" should be equal to "application/json"
687+
And the JSON node "data.updateFooDummy.fooDummy.name" should be equal to "modifiedName"
688+
And the JSON node "data.updateFooDummy.fooDummy.embeddedFoo.dummyName" should be equal to "Embedded name"
689+
And the JSON node "data.updateFooDummy.clientMutationId" should be equal to "myId"
690+
691+
@createSchema
692+
Scenario: Try to modify a non writable property through a mutation
693+
Given there is a fooDummy objects with fake names and embeddable
694+
When I send the following GraphQL request:
695+
"""
696+
mutation {
697+
updateFooDummy(input: {id: "/foo_dummies/1", name: "modifiedName", nonWritableProp: "written", embeddedFoo: {dummyName: "Embedded name"}, clientMutationId: "myId"}) {
698+
fooDummy {
699+
id
700+
name
701+
embeddedFoo {
702+
dummyName
703+
}
704+
}
705+
clientMutationId
706+
}
707+
}
708+
"""
709+
Then the response status code should be 200
710+
And the response should be in JSON
711+
And the header "Content-Type" should be equal to "application/json"
712+
And the JSON node "errors[0].message" should match '/^Field "nonWritableProp" is not defined by type "?updateFooDummyInput"?\.$/'
713+
714+
@createSchema
715+
@!mongodb
716+
Scenario: Try to modify a non writable embedded property through a mutation
717+
Given there is a fooDummy objects with fake names and embeddable
718+
When I send the following GraphQL request:
719+
"""
720+
mutation {
721+
updateFooDummy(input: {id: "/foo_dummies/1", name: "modifiedName", embeddedFoo: {dummyName: "Embedded name", nonWritableProp: "written"}, clientMutationId: "myId"}) {
722+
fooDummy {
723+
id
724+
name
725+
embeddedFoo {
726+
dummyName
727+
}
728+
}
729+
clientMutationId
730+
}
731+
}
732+
"""
733+
Then the response status code should be 200
734+
And the response should be in JSON
735+
And the header "Content-Type" should be equal to "application/json"
736+
And the JSON node "errors[0].message" should match '/^Field "nonWritableProp" is not defined by type "?FooEmbeddableNestedInput"?\.$/'
737+
665738
@!mongodb
666739
Scenario: Modify an item with composite identifiers through a mutation
667740
Given there are Composite identifier objects

features/json/relation.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ Feature: JSON relations support
2525
"badFourthLevel": null,
2626
"id": 1,
2727
"level": 3,
28-
"test": true
28+
"test": true,
29+
"relatedDummies": []
2930
}
3031
"""
3132

0 commit comments

Comments
 (0)