Skip to content

Commit fcd9a07

Browse files
committed
Merge 4.0
2 parents 9bcbc1c + 3b948b3 commit fcd9a07

35 files changed

+611
-195
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

CHANGELOG.md

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

3+
## v4.0.3
4+
5+
### Bug fixes
6+
7+
* [025f63e69](https://github.com/api-platform/core/commit/025f63e69c2ec655a828559ed78c49a365ca043b) fix(laravel): route registration of EntrypointController should be last (#6667)
8+
* [2b4937a3e](https://github.com/api-platform/core/commit/2b4937a3e09fb891b99fd8499b597190a4b740e0) fix(laravel): eloquent accessors (#6668)
9+
* [4312a1f55](https://github.com/api-platform/core/commit/4312a1f55f4f80152be93734cb5cf73c70dee53a) fix(metadata): register parameters on graphql operations
10+
* [6d4e24883](https://github.com/api-platform/core/commit/6d4e24883767f1c58dff5e52f57b0422110fa38f) fix(laravel): hiding/showing relationships (#6679)
11+
* [85306f2f5](https://github.com/api-platform/core/commit/85306f2f5a7d480b1570471689d1d3ca4e9846a3) fix(laravel): swagger ui authentication (#6661)
12+
* [a6e37068e](https://github.com/api-platform/core/commit/a6e37068ea49d1b5a4ee098a62a287d62fba1c35) fix(laravel): use Model::qualifyColumn instead of hardcoding $table.$column (#6658)
13+
* [b0d5a2ade](https://github.com/api-platform/core/commit/b0d5a2adedb583074aa93d4f641bdda419d31ffa) fix(laravel): register global middleware to secure non-rest routes
14+
* [f9d96e546](https://github.com/api-platform/core/commit/f9d96e546a37121244ab98d65c2d91f48b1bb112) fix(metadata): graphql can be disabled but with an existing operation
15+
16+
17+
### Features
18+
19+
* [df701da05](https://github.com/api-platform/core/commit/df701da05620a847f529ebabaee97f8cf5ecb37f) feat(laravel): graphql policies
20+
321
## v4.0.2
422

523
### Bug fixes
@@ -112,6 +130,21 @@ Notes:
112130

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

133+
## v3.4.2
134+
135+
### Bug fixes
136+
137+
* [0ca76fc89](https://github.com/api-platform/core/commit/0ca76fc898d2d1a679a490a5dea85473bf680901) fix(elasticsearch): allow elasticsearch 7 (#6689)
138+
* [15d61c4b7](https://github.com/api-platform/core/commit/15d61c4b75fea2b365e0852a923fed8efbae6ab8) fix(metadata): using parameters in fromClass and toClass uriVariables' options (#6663)
139+
* [2e2044636](https://github.com/api-platform/core/commit/2e204463675939903128037f82916d68f0016719) fix(metadata): parameter provider in a long running http worker (#6683)
140+
* [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)
141+
* [4f5f56756](https://github.com/api-platform/core/commit/4f5f5675629fe52ea415a6bd91f3625eedea9c87) fix: remove hydra prefix on errors (#6624)
142+
* [afe7d47d7](https://github.com/api-platform/core/commit/afe7d47d7b7ba6c8591bfb60137a65d1fa1fe38f) fix(metadata): passing class as parameter in XML ApiResource's definition (#6659)
143+
* [b93ee467c](https://github.com/api-platform/core/commit/b93ee467c69253e0cfe60e75b48a5c7aa683474a) fix(metadata): overwriting XML ApiResource definition by YAML ApiResource definition (#6660)
144+
145+
> [!WARNING]
146+
> Hydra prefix on errors is breaking, read `title` not `hydra:title`. The `hydra_prefix` flag doesn't apply to errors as it provided redundant information (both `hydra:title` and `title` were available)
147+
115148
## v3.4.1
116149

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

307+
## v3.3.14
308+
309+
### Bug fixes
310+
311+
* [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)
312+
313+
## v3.3.13
314+
315+
### Bug fixes
316+
317+
* [1b9dfccc8](https://github.com/api-platform/core/commit/1b9dfccc8d64be2b04e48490905771a77aefdd96) fix: count TraversablePaginator (#6611)
318+
* [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)
319+
* [ef0ee6427](https://github.com/api-platform/core/commit/ef0ee6427f8056bcb2617c228a7cf9ffd9d29ccd) fix(doctrine): use parameter.property for filter value (#6572)
320+
274321
## v3.3.12
275322

276323
### Bug fixes

composer.json

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,6 @@
115115
"willdurand/negotiation": "^3.1"
116116
},
117117
"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",
136118
"behat/behat": "^3.11",
137119
"behat/mink": "^1.9",
138120
"doctrine/cache": "^1.11 || ^2.1",
@@ -170,7 +152,7 @@
170152
"ramsey/uuid": "^4.0",
171153
"ramsey/uuid-doctrine": "^2.0",
172154
"soyuka/contexts": "^3.3.10",
173-
"soyuka/pmu": "^0.0.12",
155+
"soyuka/pmu": "^0.0.15",
174156
"soyuka/stubs-mongodb": "^1.0",
175157
"symfony/asset": "^6.4 || ^7.0",
176158
"symfony/browser-kit": "^6.4 || ^7.0",

features/mongodb/filters.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Feature: Filters on collections
1212
And the response should be in JSON
1313
And the header "Content-Type" should be equal to "application/problem+json; charset=utf-8"
1414
And the JSON node "@context" should be equal to "/contexts/Error"
15-
And the JSON node "@type" should be equal to "hydra:Error"
16-
And the JSON node "hydra:title" should be equal to "An error occurred"
17-
And the JSON node "hydra:description" should be equal to "Cannot use reference 'badFourthLevel' in class 'ThirdLevel' for lookup or graphLookup: dbRef references are not supported."
15+
And the JSON node "@type" should be equal to "Error"
16+
And the JSON node "title" should be equal to "An error occurred"
17+
And the JSON node "description" should be equal to "Cannot use reference 'badFourthLevel' in class 'ThirdLevel' for lookup or graphLookup: dbRef references are not supported."
1818
And the JSON node "trace" should exist
1919

2020
Scenario: Error when getting collection with nested properties if references are not correctly stored (not owning side)
@@ -23,7 +23,7 @@ Feature: Filters on collections
2323
And the response should be in JSON
2424
And the header "Content-Type" should be equal to "application/problem+json; charset=utf-8"
2525
And the JSON node "@context" should be equal to "/contexts/Error"
26-
And the JSON node "@type" should be equal to "hydra:Error"
27-
And the JSON node "hydra:title" should be equal to "An error occurred"
28-
And the JSON node "hydra:description" should be equal to "Cannot use reference 'badThirdLevel' in class 'FourthLevel' for lookup or graphLookup: dbRef references are not supported."
26+
And the JSON node "@type" should be equal to "Error"
27+
And the JSON node "title" should be equal to "An error occurred"
28+
And the JSON node "description" should be equal to "Cannot use reference 'badThirdLevel' in class 'FourthLevel' for lookup or graphLookup: dbRef references are not supported."
2929
And the JSON node "trace" should exist

generate-changelog.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
#!/bin/bash
22
# usage: generate-changelog.sh previous_tag next_tag
33
# example: generate-changelog.sh v2.7.2 v2.7.3 > CHANGELOG.new.md
4-
log=$(git log "$1..HEAD" --pretty='format:* [%h](https://github.com/api-platform/core/commit/%H) %s' --no-merges)
4+
lowerbranch=$(git branch --merged HEAD | grep '[[:digit:]]\.[[:digit:]]' | grep -v '*' | sort -rg | head -n 1)
5+
log=$(git log "$1..HEAD" --no-merges --not $lowerbranch --pretty='format:* [%h](https://github.com/api-platform/core/commit/%H) %s')
56

67
diff=$(
78
printf "# Changelog\n\n"
89
printf "## %s\n\n" "$2"
910
10-
if [[ 0 != $(echo "$log" | grep fix | grep -v chore | wc -l) ]];
11+
fixes=$(echo "$log" | grep 'fix(\|fix:')
12+
if [[ 0 != $(echo "$fixes" | wc -l) ]];
1113
then
1214
printf "### Bug fixes\n\n"
13-
printf "$log" | grep fix | grep -v chore | sort
15+
printf "$fixes" | sort
1416
printf "\n\n"
1517
fi
1618
17-
if [[ 0 != $(echo "$log" | grep feat | grep -v chore | wc -l) ]];
19+
feat=$(echo "$log" | grep 'feat(\|feat:')
20+
if [[ 0 != $(echo "$feat" | wc -l) ]];
1821
then
1922
printf "### Features\n\n"
20-
printf "$log" | grep feat | grep -v chore | sort
23+
printf "$feat" | sort
2124
fi
2225
)
2326

src/GraphQl/Type/FieldsBuilder.php

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
use ApiPlatform\GraphQl\Exception\InvalidTypeException;
1919
use ApiPlatform\GraphQl\Resolver\Factory\ResolverFactoryInterface;
2020
use ApiPlatform\GraphQl\Type\Definition\TypeInterface;
21+
use ApiPlatform\Metadata\FilterInterface;
2122
use ApiPlatform\Metadata\GraphQl\Mutation;
2223
use ApiPlatform\Metadata\GraphQl\Operation;
2324
use ApiPlatform\Metadata\GraphQl\Query;
2425
use ApiPlatform\Metadata\GraphQl\Subscription;
2526
use ApiPlatform\Metadata\InflectorInterface;
27+
use ApiPlatform\Metadata\OpenApiParameterFilterInterface;
2628
use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
2729
use ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface;
2830
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
@@ -296,20 +298,40 @@ public function resolveResourceArgs(array $args, Operation $operation): array
296298
continue;
297299
}
298300

301+
$filter = $this->filterLocator->get($filterId);
299302
$parsedKey = explode('[:property]', $key);
300303
$flattenFields = [];
301-
foreach ($this->filterLocator->get($filterId)->getDescription($operation->getClass()) as $key => $value) {
302-
$values = [];
303-
parse_str($key, $values);
304-
if (isset($values[$parsedKey[0]])) {
305-
$values = $values[$parsedKey[0]];
304+
305+
if ($filter instanceof FilterInterface) {
306+
foreach ($filter->getDescription($operation->getClass()) as $name => $value) {
307+
$values = [];
308+
parse_str($name, $values);
309+
if (isset($values[$parsedKey[0]])) {
310+
$values = $values[$parsedKey[0]];
311+
}
312+
313+
$name = key($values);
314+
$flattenFields[] = ['name' => $name, 'required' => $value['required'] ?? null, 'description' => $value['description'] ?? null, 'leafs' => $values[$name], 'type' => $value['type'] ?? 'string'];
315+
}
316+
317+
$args[$parsedKey[0]] = $this->parameterToObjectType($flattenFields, $parsedKey[0]);
318+
}
319+
320+
if ($filter instanceof OpenApiParameterFilterInterface) {
321+
foreach ($filter->getOpenApiParameters($parameter) as $value) {
322+
$values = [];
323+
parse_str($value->getName(), $values);
324+
if (isset($values[$parsedKey[0]])) {
325+
$values = $values[$parsedKey[0]];
326+
}
327+
328+
$name = key($values);
329+
$flattenFields[] = ['name' => $name, 'required' => $value->getRequired(), 'description' => $value->getDescription(), 'leafs' => $values[$name], 'type' => $value->getSchema()['type'] ?? 'string'];
306330
}
307331

308-
$name = key($values);
309-
$flattenFields[] = ['name' => $name, 'required' => $value['required'] ?? null, 'description' => $value['description'] ?? null, 'leafs' => $values[$name], 'type' => $value['type'] ?? 'string'];
332+
$args[$parsedKey[0]] = $this->parameterToObjectType($flattenFields, $parsedKey[0].$operation->getShortName().$operation->getName());
310333
}
311334

312-
$args[$parsedKey[0]] = $this->parameterToObjectType($flattenFields, $parsedKey[0]);
313335
continue;
314336
}
315337

0 commit comments

Comments
 (0)