Skip to content

Commit 22abe41

Browse files
authored
Merge branch '4.0' into toitzi/relationships
2 parents 2d57498 + 8109906 commit 22abe41

File tree

160 files changed

+4914
-630
lines changed

Some content is hidden

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

160 files changed

+4914
-630
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
path: ${{ steps.composercache.outputs.dir }}
6262
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
6363
restore-keys: ${{ runner.os }}-composer-
64+
- run: composer validate
6465
- name: Update project dependencies
6566
run: |
6667
composer global require soyuka/pmu

.github/workflows/subtree.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ on:
55
- v*
66
branches:
77
- main
8-
- 3.1
9-
- 3.2
8+
- '3.1'
9+
- '3.2'
10+
- '3.3'
11+
- '3.4'
12+
- '4.0'
1013

1114
env:
1215
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
->in(__DIR__)
1616
->exclude([
1717
'src/Core/Bridge/Symfony/Maker/Resources/skeleton',
18+
'src/Laravel/Console/Maker/Resources/skeleton',
1819
'src/Laravel/config',
1920
'tests/Fixtures/app/var',
2021
'docs/guides',

CHANGELOG.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,80 @@
11
# Changelog
22

3+
## v4.0.8
4+
5+
### Bug fixes
6+
7+
* [dddb97075](https://github.com/api-platform/core/commit/dddb97075af9c6e2517e1881b803c9d31a1913cf) fix(symfony): default formats order (#6780)
8+
9+
### Features
10+
11+
## v4.0.7
12+
13+
### Bug fixes
14+
15+
* [17c916c3a](https://github.com/api-platform/core/commit/17c916c3a1bcc837c9bc842dc48390dbeb043450) fix(symfony): BackedEnumProvider typo fix (#6769)
16+
* [216d9ccaa](https://github.com/api-platform/core/commit/216d9ccaacf7845daaaeab30f3a58bb5567430fe) fix(serializer): fetch type on normalization error when possible (#6761)
17+
* [2f967d934](https://github.com/api-platform/core/commit/2f967d9345004779f409b9ce1b5d0cbba84c7132) fix(doctrine): throw an exception when a filter is not found in a parameter (#6767)
18+
* [6c9b508b0](https://github.com/api-platform/core/commit/6c9b508b030976741a68f84e226502e6c218e896) fix(laravel): remove link header when jsonld is not enabled (#6768)
19+
* [736ca045e](https://github.com/api-platform/core/commit/736ca045e6832f04aaa002ddd7b85c55df4696bb) fix(validator): allow to pass both a ConstraintViolationList and a previous exception (#6762)
20+
* [9ac3661b6](https://github.com/api-platform/core/commit/9ac3661b6a75255832203b87a9ba7994add64061) fix(hydra): store and use hydra context in a local variable (#6765)
21+
22+
### Features
23+
24+
## v4.0.6
25+
26+
### Bug fixes
27+
28+
* [195c4e788](https://github.com/api-platform/core/commit/195c4e7883520416e042ac78143b18652a216fbf) fix(hydra): hydra context changed (#6710)
29+
* [4f65ef2d0](https://github.com/api-platform/core/commit/4f65ef2d061215df348e3505856f0f41c7c909ed) fix(metadata): providing parameter constraints skips automatic ones (#6756)
30+
* [5a8ef115a](https://github.com/api-platform/core/commit/5a8ef115a90791992a6c1325fb6d1ac458b22153) fix(symfony): ECMA-262 pattern with RegExp validator (#6733)
31+
* [67c5a2a24](https://github.com/api-platform/core/commit/67c5a2a2463bca94f0997b4fab1248a08994465b) fix(laravel): jsonapi error serialization (#6755)
32+
* [ac6f667f3](https://github.com/api-platform/core/commit/ac6f667f301f6c4c399a707faf00567239bd98d8) fix(laravel): collection relations other than HasMany (#6737)
33+
34+
### Features
35+
36+
* [cecd77149](https://github.com/api-platform/core/commit/cecd77149795c1a455ac72bc3ed0606413e69900) feat(laravel): use laravel cache setting (#6751)
37+
38+
## v4.0.5
39+
40+
### Bug fixes
41+
42+
* [4171d5f9c](https://github.com/api-platform/core/commit/4171d5f9cd41731b857c53a186270ba0626baedf) fix(graphql): register query parameter arguments with filters (#6726)
43+
* [48ab53816](https://github.com/api-platform/core/commit/48ab53816c55e6116aa64ac81f522f4b7b9bb9f6) fix(laravel): make command writes to app instead of src (#6723)
44+
45+
### Features
46+
47+
## v4.0.4
48+
49+
### Bug fixes
50+
51+
* [2e8287dad](https://github.com/api-platform/core/commit/2e8287dad0c0315dd6527279a6359c0a22f40d93) fix(laravel): allow serializer attributes through ApiProperty (#6680)
52+
* [439c188ea](https://github.com/api-platform/core/commit/439c188ea1685676d5e705a49a4b835f35a84d72) fix(laravel): match integer type (#6715)
53+
* [4ad7a50aa](https://github.com/api-platform/core/commit/4ad7a50aaabf0d85e2eb5bb3a6d4ef8d5b7b39a7) fix(laravel): openapi Options binding (#6714)
54+
* [ec6e64512](https://github.com/api-platform/core/commit/ec6e6451299a50fcab397e86fafe6db132ce7519) fix(laravel): skip resource path when not available (#6697)
55+
56+
### Features
57+
58+
* [5aa799321](https://github.com/api-platform/core/commit/5aa7993219a6fb55f11476a031963a542b2d3586) feat(laravel): command to generate state providers/processors (#6708)
59+
60+
## v4.0.3
61+
62+
### Bug fixes
63+
64+
* [025f63e69](https://github.com/api-platform/core/commit/025f63e69c2ec655a828559ed78c49a365ca043b) fix(laravel): route registration of EntrypointController should be last (#6667)
65+
* [2b4937a3e](https://github.com/api-platform/core/commit/2b4937a3e09fb891b99fd8499b597190a4b740e0) fix(laravel): eloquent accessors (#6668)
66+
* [4312a1f55](https://github.com/api-platform/core/commit/4312a1f55f4f80152be93734cb5cf73c70dee53a) fix(metadata): register parameters on graphql operations
67+
* [6d4e24883](https://github.com/api-platform/core/commit/6d4e24883767f1c58dff5e52f57b0422110fa38f) fix(laravel): hiding/showing relationships (#6679)
68+
* [85306f2f5](https://github.com/api-platform/core/commit/85306f2f5a7d480b1570471689d1d3ca4e9846a3) fix(laravel): swagger ui authentication (#6661)
69+
* [a6e37068e](https://github.com/api-platform/core/commit/a6e37068ea49d1b5a4ee098a62a287d62fba1c35) fix(laravel): use Model::qualifyColumn instead of hardcoding $table.$column (#6658)
70+
* [b0d5a2ade](https://github.com/api-platform/core/commit/b0d5a2adedb583074aa93d4f641bdda419d31ffa) fix(laravel): register global middleware to secure non-rest routes
71+
* [f9d96e546](https://github.com/api-platform/core/commit/f9d96e546a37121244ab98d65c2d91f48b1bb112) fix(metadata): graphql can be disabled but with an existing operation
72+
73+
74+
### Features
75+
76+
* [df701da05](https://github.com/api-platform/core/commit/df701da05620a847f529ebabaee97f8cf5ecb37f) feat(laravel): graphql policies
77+
378
## v4.0.2
479

580
### Bug fixes
@@ -112,6 +187,43 @@ Notes:
112187

113188
* [0d5f35683](https://github.com/api-platform/core/commit/0d5f356839eb6aa9f536044abe4affa736553e76) feat(laravel): laravel component (#5882)
114189

190+
## v3.4.5
191+
192+
### Bug fixes
193+
194+
* [fc8fa00a1](https://github.com/api-platform/core/commit/fc8fa00a19320b65547a60537261959c11f8e6a8) fix(hydra): iri template when using query parameter (#6742)
195+
196+
## v3.4.4
197+
198+
### Bug fixes
199+
200+
* [550347867](https://github.com/api-platform/core/commit/550347867f30611b673d8df99f65186d013919dd) fix(graphql): register query parameter arguments with filters (#6727)
201+
* [99262dce7](https://github.com/api-platform/core/commit/99262dce739800bd841c95e026848b587ba25801) fix(jsonschema): handle @id when genId is false (#6716)
202+
* [ad5efa535](https://github.com/api-platform/core/commit/ad5efa535a4dcbaad64ecff89514eaa6e07f5b7c) fix: multiple parameter provider #6673 (#6732)
203+
* [d34cd7be8](https://github.com/api-platform/core/commit/d34cd7be8e7a12fd08a8b10270a614c06c10aa89) fix: use stateOptions when retrieving a Parameter filter (#6728)
204+
* [e7fb04fab](https://github.com/api-platform/core/commit/e7fb04fab05bc077e2dbeb0fa0fc2c1d28c96105) fix(symfony): fetch api-platform/symfony version debug bar (#6722)
205+
* [e96623ebf](https://github.com/api-platform/core/commit/e96623ebfd8691ba943bdb56a4d91e160497a311) fix(jsonld): prefix error @type with hydra: (#6721)
206+
207+
## v3.4.3
208+
209+
### Bug fixes
210+
211+
* [3ca599158](https://github.com/api-platform/core/commit/3ca599158139d56fbd6ee66f2de3e586120d735c) fix(hydra): hydra_prefix on errors (#6704)
212+
* [f7f605dc8](https://github.com/api-platform/core/commit/f7f605dc8b798b975d2286c970c9091436d7f890) fix: check that api-platform/ramsey-uuid is installed before registering related services (#6696)
213+
* [fbb53e5e3](https://github.com/api-platform/core/commit/fbb53e5e35ca0ec3de26ddc7de7ea4d1dda5c20b) fix(symfony): metadata aware name converter has 0 arguments by default (#6711)
214+
215+
## v3.4.2
216+
217+
### Bug fixes
218+
219+
* [0ca76fc89](https://github.com/api-platform/core/commit/0ca76fc898d2d1a679a490a5dea85473bf680901) fix(elasticsearch): allow elasticsearch 7 (#6689)
220+
* [15d61c4b7](https://github.com/api-platform/core/commit/15d61c4b75fea2b365e0852a923fed8efbae6ab8) fix(metadata): using parameters in fromClass and toClass uriVariables' options (#6663)
221+
* [2e2044636](https://github.com/api-platform/core/commit/2e204463675939903128037f82916d68f0016719) fix(metadata): parameter provider in a long running http worker (#6683)
222+
* [4c58b33e8](https://github.com/api-platform/core/commit/4c58b33e8c5a90f9377543bd068288dcf84e3236) fix(jsonapi): fixed definition name to allow using the same class names in different namespaces (#6676)
223+
* [4f5f56756](https://github.com/api-platform/core/commit/4f5f5675629fe52ea415a6bd91f3625eedea9c87) fix: remove hydra prefix on errors (#6624)
224+
* [afe7d47d7](https://github.com/api-platform/core/commit/afe7d47d7b7ba6c8591bfb60137a65d1fa1fe38f) fix(metadata): passing class as parameter in XML ApiResource's definition (#6659)
225+
* [b93ee467c](https://github.com/api-platform/core/commit/b93ee467c69253e0cfe60e75b48a5c7aa683474a) fix(metadata): overwriting XML ApiResource definition by YAML ApiResource definition (#6660)
226+
115227
## v3.4.1
116228

117229
### Bug fixes
@@ -271,6 +383,20 @@ You should now install `api-platform/symfony` instead of `api-platform/core`.
271383
* [74986cb55](https://github.com/api-platform/core/commit/74986cb552182dc645bd1fc967faa0954dd59e0a) feat: inflector as service (#6447)
272384
* [b47edb2a4](https://github.com/api-platform/core/commit/b47edb2a499c34e79c167f963e3a626a3e9d040a) feat(serializer): context IRI in HAL or JsonApi format (#6215)
273385

386+
## v3.3.14
387+
388+
### Bug fixes
389+
390+
* [4c58b33e8](https://github.com/api-platform/core/commit/4c58b33e8c5a90f9377543bd068288dcf84e3236) fix(jsonapi): fixed definition name to allow using the same class names in different namespaces (#6676)
391+
392+
## v3.3.13
393+
394+
### Bug fixes
395+
396+
* [1b9dfccc8](https://github.com/api-platform/core/commit/1b9dfccc8d64be2b04e48490905771a77aefdd96) fix: count TraversablePaginator (#6611)
397+
* [4c58b33e8](https://github.com/api-platform/core/commit/4c58b33e8c5a90f9377543bd068288dcf84e3236) fix(jsonapi): fixed definition name to allow using the same class names in different namespaces (#6676)
398+
* [ef0ee6427](https://github.com/api-platform/core/commit/ef0ee6427f8056bcb2617c228a7cf9ffd9d29ccd) fix(doctrine): use parameter.property for filter value (#6572)
399+
274400
## v3.3.12
275401

276402
### Bug fixes

composer.json

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
"autoload": {
1010
"psr-4": {
1111
"ApiPlatform\\": "src/"
12-
}
12+
},
13+
"files": [
14+
"src/JsonLd/HydraContext.php"
15+
]
1316
},
1417
"autoload-dev": {
1518
"psr-4": {
@@ -115,24 +118,6 @@
115118
"willdurand/negotiation": "^3.1"
116119
},
117120
"require-dev": {
118-
"api-platform/doctrine-common": "^3.4 || ^4.0",
119-
"api-platform/doctrine-odm": "^3.4 || ^4.0",
120-
"api-platform/doctrine-orm": "^3.4 || ^4.0",
121-
"api-platform/documentation": "^3.4 || ^4.0",
122-
"api-platform/elasticsearch": "^3.4 || ^4.0",
123-
"api-platform/graphql": "^3.4 || ^4.0",
124-
"api-platform/http-cache": "^3.4 || ^4.0",
125-
"api-platform/hydra": "^3.4 || ^4.0",
126-
"api-platform/json-api": "^3.3 || ^4.0",
127-
"api-platform/json-schema": "^3.4 || ^4.0",
128-
"api-platform/jsonld": "^3.4 || ^4.0",
129-
"api-platform/metadata": "^3.4 || ^4.0",
130-
"api-platform/openapi": "^3.4 || ^4.0",
131-
"api-platform/ramsey-uuid": "^3.4 || ^4.0",
132-
"api-platform/json-hal": "^3.4 || ^4.0",
133-
"api-platform/serializer": "^3.4 || ^4.0",
134-
"api-platform/state": "^3.4 || ^4.0",
135-
"api-platform/validator": "^3.4 || ^4.0",
136121
"behat/behat": "^3.11",
137122
"behat/mink": "^1.9",
138123
"doctrine/cache": "^1.11 || ^2.1",
@@ -170,7 +155,7 @@
170155
"ramsey/uuid": "^4.0",
171156
"ramsey/uuid-doctrine": "^2.0",
172157
"soyuka/contexts": "^3.3.10",
173-
"soyuka/pmu": "^0.0.12",
158+
"soyuka/pmu": "^0.0.15",
174159
"soyuka/stubs-mongodb": "^1.0",
175160
"symfony/asset": "^6.4 || ^7.0",
176161
"symfony/browser-kit": "^6.4 || ^7.0",

docs/guides/doctrine-search-filter.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,24 +120,21 @@ public function testGetDocumentation(): void
120120
$this->assertJsonContains([
121121
'search' => [
122122
'@type' => 'IriTemplate',
123-
'template' => '/books.jsonld{?id,title,author}',
123+
'template' => '/books.jsonld{?title,author}',
124124
'variableRepresentation' => 'BasicRepresentation',
125125
'mapping' => [
126-
[
127-
'@type' => 'IriTemplateMapping',
128-
'variable' => 'id',
129-
'property' => 'id',
130-
],
131126
[
132127
'@type' => 'IriTemplateMapping',
133128
'variable' => 'title',
134129
'property' => 'title',
130+
'required' => false,
135131
],
136132
[
137133
'@type' => 'IriTemplateMapping',
138134
'variable' => 'author',
139135
'property' => 'author',
140-
]
136+
'required' => false,
137+
],
141138
],
142139
],
143140
]);

docs/guides/error-resource.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ class MyDomainException extends \Exception implements ProblemExceptionInterface
1818
{
1919
public function getType(): string
2020
{
21-
return 'teapot';
21+
return '/errors/418';
2222
}
2323

2424
public function getTitle(): ?string
2525
{
26-
return null;
26+
return 'Teapot error';
2727
}
2828

2929
public function getStatus(): ?int
@@ -40,6 +40,8 @@ public function getInstance(): ?string
4040
{
4141
return null;
4242
}
43+
44+
public string $myCustomField = 'I usually prefer coffee.';
4345
}
4446

4547
use ApiPlatform\Metadata\ApiResource;
@@ -83,7 +85,12 @@ public function testBookDoesNotExists(): void
8385
// you can override this by looking at the [Error Provider guide](/docs/guides/error-provider).
8486
$this->assertResponseStatusCodeSame(418);
8587
$this->assertJsonContains([
88+
'@id' => '/my_domain_exceptions',
89+
'@type' => 'MyDomainException',
90+
'type' => '/errors/418',
91+
'title' => 'Teapot error',
8692
'detail' => 'I am teapot',
93+
'myCustomField' => 'I usually prefer coffee.'
8794
]);
8895
}
8996
}

features/hydra/collection.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ Feature: Collections support
480480

481481
When I send a "GET" request to "/dummies?itemsPerPage=0&page=2"
482482
Then the response status code should be 400
483-
And the JSON node "hydra:description" should be equal to "Page should not be greater than 1 if limit is equal to 0"
483+
And the JSON node "description" should be equal to "Page should not be greater than 1 if limit is equal to 0"
484484

485485
Scenario: Cursor-based pagination with an empty collection
486486
When I send a "GET" request to "/so_manies"

features/hydra/docs.feature

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,19 @@ Feature: Documentation support
1313
And the response should be in JSON
1414
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
1515
# Context
16-
And the JSON node "@context.@vocab" should be equal to "http://example.com/docs.jsonld#"
17-
And the JSON node "@context.hydra" should be equal to "http://www.w3.org/ns/hydra/core#"
18-
And the JSON node "@context.rdf" should be equal to "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
19-
And the JSON node "@context.rdfs" should be equal to "http://www.w3.org/2000/01/rdf-schema#"
20-
And the JSON node "@context.xmls" should be equal to "http://www.w3.org/2001/XMLSchema#"
21-
And the JSON node "@context.owl" should be equal to "http://www.w3.org/2002/07/owl#"
22-
And the JSON node "@context.domain.@id" should be equal to "rdfs:domain"
23-
And the JSON node "@context.domain.@type" should be equal to "@id"
24-
And the JSON node "@context.range.@id" should be equal to "rdfs:range"
25-
And the JSON node "@context.range.@type" should be equal to "@id"
26-
And the JSON node "@context.subClassOf.@id" should be equal to "rdfs:subClassOf"
27-
And the JSON node "@context.subClassOf.@type" should be equal to "@id"
28-
And the JSON node "@context.expects.@id" should be equal to "hydra:expects"
29-
And the JSON node "@context.expects.@type" should be equal to "@id"
30-
And the JSON node "@context.returns.@id" should be equal to "hydra:returns"
31-
And the JSON node "@context.returns.@type" should be equal to "@id"
16+
And the Hydra context matches the online resource "http://www.w3.org/ns/hydra/context.jsonld"
17+
And the JSON node "@context[1].@vocab" should be equal to "http://example.com/docs.jsonld#"
18+
And the JSON node "@context[1].hydra" should be equal to "http://www.w3.org/ns/hydra/core#"
19+
And the JSON node "@context[1].rdf" should be equal to "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
20+
And the JSON node "@context[1].rdfs" should be equal to "http://www.w3.org/2000/01/rdf-schema#"
21+
And the JSON node "@context[1].xmls" should be equal to "http://www.w3.org/2001/XMLSchema#"
22+
And the JSON node "@context[1].owl" should be equal to "http://www.w3.org/2002/07/owl#"
23+
And the JSON node "@context[1].domain.@id" should be equal to "rdfs:domain"
24+
And the JSON node "@context[1].domain.@type" should be equal to "@id"
25+
And the JSON node "@context[1].range.@id" should be equal to "rdfs:range"
26+
And the JSON node "@context[1].range.@type" should be equal to "@id"
27+
And the JSON node "@context[1].subClassOf.@id" should be equal to "rdfs:subClassOf"
28+
And the JSON node "@context[1].subClassOf.@type" should be equal to "@id"
3229
# Root properties
3330
And the JSON node "@id" should be equal to "/docs.jsonld"
3431
And the JSON node "hydra:title" should be equal to "My Dummy API"
@@ -79,7 +76,7 @@ Feature: Documentation support
7976
And the value of the node "hydra:method" of the operation "GET" of the Hydra class "Dummy" is "GET"
8077
And the value of the node "hydra:title" of the operation "GET" of the Hydra class "Dummy" is "Retrieves a Dummy resource."
8178
And the value of the node "rdfs:label" of the operation "GET" of the Hydra class "Dummy" is "Retrieves a Dummy resource."
82-
And the value of the node "returns" of the operation "GET" of the Hydra class "Dummy" is "#Dummy"
79+
And the value of the node "returns" of the operation "GET" of the Hydra class "Dummy" is "Dummy"
8380
And the value of the node "hydra:title" of the operation "PUT" of the Hydra class "Dummy" is "Replaces the Dummy resource."
8481
And the value of the node "hydra:title" of the operation "DELETE" of the Hydra class "Dummy" is "Deletes the Dummy resource."
8582
And the value of the node "returns" of the operation "DELETE" of the Hydra class "Dummy" is "owl:Nothing"

0 commit comments

Comments
 (0)