Skip to content

Commit a8d0c84

Browse files
committed
Merge 4.1
2 parents 9389b4f + 361fd6c commit a8d0c84

27 files changed

+175
-48
lines changed

CHANGELOG.md

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

3+
## v4.1.0-alpha.1
4+
5+
### Bug fixes
6+
7+
* [67fbe51c5](https://github.com/api-platform/core/commit/67fbe51c570abe1ece6651ae6a037662e9012881) fix: reintroduce the `show_webby` parameter in Laravel config (#6741)
8+
9+
### Features
10+
11+
* [00787f32d](https://github.com/api-platform/core/commit/00787f32da54418de7d869cff218e22d8ae2ae1d) feat(laravel): automatically register policies (#6623)
12+
* [12c42096b](https://github.com/api-platform/core/commit/12c42096bb0006d6ebae60ae5d90e9b356f9a335) feat(metadata): ability to hide an hydra class/operation (#6871)
13+
* [57f15cf4f](https://github.com/api-platform/core/commit/57f15cf4f38278315c5f31d3949416c9455ba0d0) feat(state): strict query parameters (#6399)
14+
* [bd0e92936](https://github.com/api-platform/core/commit/bd0e92936f82d3cd4563cd45ebf1f73fd1db9f01) feat(openapi): HTTP Authentication Support for Swagger UI (#6665)
15+
* [be98f4e01](https://github.com/api-platform/core/commit/be98f4e01a52d8341ef9b65ed2f4e3b46ab31165) feat(graphql): allow to configure max query depth and max query complexity (#6880)
16+
* [c78ed0b78](https://github.com/api-platform/core/commit/c78ed0b78baf5d2e1b7444a9882ba039c70a3887) feat(laravel): boolean filter (#6806)
17+
* [d0a442786](https://github.com/api-platform/core/commit/d0a44278630d201b91cbba0774a09f4eeaac88f7) feat(doctrine): enhance getLinksHandler with method validation and typo suggestions (#6874)
18+
* [f67f6f1ac](https://github.com/api-platform/core/commit/f67f6f1acb6476182c18a3503f2a8bc80ae89a0b) feat(doctrine): doctrine filters like laravel eloquent filters (#6775)
19+
20+
## v4.0.14
21+
22+
### Bug fixes
23+
24+
* [97cdb6b3f](https://github.com/api-platform/core/commit/97cdb6b3f43471789e096c9dc3a0c3c7b6d4e43c) fix(state): remove ProcessorInterface laravel specific type
25+
* [b12a0d005](https://github.com/api-platform/core/commit/b12a0d005fda58a162b82a3574e6ee877838a55b) fix(graphql): register types for parameter args (#6895)
26+
27+
### Features
28+
329
## v4.0.13
430

531
### Bug fixes
@@ -248,6 +274,18 @@ Notes:
248274

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

277+
## v3.4.14
278+
279+
### Bug fixes
280+
281+
* [0cf752bce](https://github.com/api-platform/core/commit/0cf752bcec692718b2503250e655d05aea670316) fix(metadata): make the schema attribute to fallback to null for parameters in YamlResourceExtractor (#6896)
282+
* [2b3c55db2](https://github.com/api-platform/core/commit/2b3c55db2a9ecc52f62c441fa8a5696233a30b87) fix(symfony): remove unsolvable deprecation (#6899) see also (#6655)
283+
* [9493b9b6e](https://github.com/api-platform/core/commit/9493b9b6ec0264ab5b700c861ad1b97455b4f88d) fix(symfony): revert json schema bc break (#6903)
284+
* [b82f9ac76](https://github.com/api-platform/core/commit/b82f9ac76ce89dd3910849c73da42317ee1339ed) fix(openapi): not forbidden response on openAPI doc (#6886)
285+
286+
I mispublished a v3.4.13 on some repositories to fix them all I bumped 3.4.10 to 3.4.14
287+
More details at #6888.
288+
251289
## v3.4.10
252290

253291
### Bug fixes

src/GraphQl/Type/FieldsBuilder.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,15 @@ private function getResourceFieldConfiguration(?string $property, ?string $field
415415
}
416416

417417
$args = $this->getFilterArgs($args, $resourceClass, $rootResource, $resourceOperation, $rootOperation, $property, $depth);
418-
$args = $this->getParameterArgs($rootOperation, $args);
418+
419+
// Also register parameter args in the types container
420+
// Note: This is a workaround, for more information read the comment on the parameterToObjectType function.
421+
foreach ($this->getParameterArgs($rootOperation) as $key => $arg) {
422+
if ($arg instanceof InputObjectType || (\is_array($arg) && isset($arg['name']))) {
423+
$this->typesContainer->set(\is_array($arg) ? $arg['name'] : $arg->name(), $arg);
424+
}
425+
$args[$key] = $arg;
426+
}
419427
}
420428
}
421429

src/Laravel/Eloquent/Filter/DateFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ public function getSchema(Parameter $parameter): array
8484
return ['type' => 'date'];
8585
}
8686

87-
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null
87+
/**
88+
* @return OpenApiParameter[]
89+
*/
90+
public function getOpenApiParameters(Parameter $parameter): array
8891
{
8992
$in = $parameter instanceof QueryParameter ? 'query' : 'header';
9093
$key = $parameter->getKey();

src/Laravel/Eloquent/Filter/OrFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function getSchema(Parameter $parameter): array
4949
return ['type' => 'array', 'items' => $schema];
5050
}
5151

52-
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null
52+
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter
5353
{
5454
return new OpenApiParameter(name: $parameter->getKey().'[]', in: 'query', style: 'deepObject', explode: true);
5555
}

src/Laravel/Eloquent/Filter/OrderFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ public function getSchema(Parameter $parameter): array
5454
return ['type' => 'string', 'enum' => ['asc', 'desc']];
5555
}
5656

57-
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null
57+
/**
58+
* @return OpenApiParameter[]|null
59+
*/
60+
public function getOpenApiParameters(Parameter $parameter): ?array
5861
{
5962
if (str_contains($parameter->getKey(), ':property')) {
6063
$parameters = [];

src/Laravel/Eloquent/Filter/RangeFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ public function getSchema(Parameter $parameter): array
5252
return ['type' => 'number'];
5353
}
5454

55-
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null
55+
/**
56+
* @return OpenApiParameter[]
57+
*/
58+
public function getOpenApiParameters(Parameter $parameter): array
5659
{
5760
$in = $parameter instanceof QueryParameter ? 'query' : 'header';
5861
$key = $parameter->getKey();

src/Laravel/Eloquent/Metadata/Factory/Property/EloquentPropertyMetadataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function create(string $resourceClass, string $property, array $options =
8888

8989
return $propertyMetadata
9090
->withBuiltinTypes([$type])
91-
->withWritable($propertyMetadata->isWritable() ?? true)
91+
->withWritable($propertyMetadata->isWritable() ?? true === $p['fillable'])
9292
->withReadable($propertyMetadata->isReadable() ?? false === $p['hidden']);
9393
}
9494

src/Laravel/Eloquent/Paginator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434

3535
public function count(): int
3636
{
37-
return $this->paginator->count();
37+
return $this->paginator->count(); // @phpstan-ignore-line
3838
}
3939

4040
public function getLastPage(): float

src/Laravel/Eloquent/PartialPaginator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(
3333

3434
public function count(): int
3535
{
36-
return $this->paginator->count();
36+
return $this->paginator->count(); // @phpstan-ignore-line
3737
}
3838

3939
public function getCurrentPage(): float

src/Laravel/Routing/IriConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private function generateRoute(object|string $resource, int $referenceType = Url
159159
if (\is_object($resource)) {
160160
try {
161161
$identifiers = $this->identifiersExtractor->getIdentifiersFromItem($resource, $identifiersExtractorOperation, $context);
162-
} catch (InvalidArgumentException|RuntimeException $e) {
162+
} catch (RuntimeException $e) {
163163
// We can try using context uri variables if any
164164
if (!$identifiers) {
165165
throw new InvalidArgumentException(\sprintf('Unable to generate an IRI for the item of type "%s"', $operation->getClass()), $e->getCode(), $e);

0 commit comments

Comments
 (0)