Skip to content

Commit effc99e

Browse files
committed
Merge 4.3
2 parents c2909a1 + 7e737d5 commit effc99e

File tree

98 files changed

+1988
-387
lines changed

Some content is hidden

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

98 files changed

+1988
-387
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010

1111
env:
1212
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13-
COMPOSER_ROOT_VERSION: "4.2.x-dev"
13+
COMPOSER_ROOT_VERSION: "4.3.x-dev"
1414

1515
jobs:
1616
architecture:
@@ -227,7 +227,7 @@ jobs:
227227
mkdir -p /tmp/openapi
228228
tests/Fixtures/app/console api:openapi:export --output=/tmp/openapi/openapi.json --no-ansi
229229
- name: Lint OpenAPI spec with Redocly
230-
run: redocly lint /tmp/openapi/openapi.json
230+
run: redocly lint --config .redocly.yaml /tmp/openapi/openapi.json
231231

232232
phpunit:
233233
name: PHPUnit (PHP ${{ matrix.php }})
@@ -1472,6 +1472,13 @@ jobs:
14721472
composer global link ../src/Laravel --permanent
14731473
composer config minimum-stability dev
14741474
composer config prefer-stable true
1475-
composer require api-platform/laravel:"@dev"
1475+
composer require api-platform/laravel:"@dev" -W
14761476
php ./artisan api-platform:install
14771477
working-directory: 'test-api-platform-install'
1478+
- name: Smoke test
1479+
run: |
1480+
php ./artisan serve &
1481+
sleep 2
1482+
curl -f http://127.0.0.1:8000/api || exit 1
1483+
kill %1
1484+
working-directory: 'test-api-platform-install'

.github/workflows/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,21 @@ jobs:
6161
env:
6262
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
6363
run: gh workflow run -R api-platform/api-platform release.yml -f tag=${{ github.ref_name }}
64+
65+
dispatch-demo-update:
66+
name: Dispatch Demo Update
67+
runs-on: ubuntu-latest
68+
needs: split
69+
if: startsWith(github.ref, 'refs/tags/')
70+
steps:
71+
- name: Generate App Token
72+
id: generate_token
73+
uses: tibdex/github-app-token@v2
74+
with:
75+
app_id: ${{ secrets.API_PLATFORM_APP_ID }}
76+
private_key: ${{ secrets.API_PLATFORM_APP_PRIVATE_KEY }}
77+
78+
- name: Update demo
79+
env:
80+
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
81+
run: gh workflow run -R api-platform/demo upgrade-api-platform.yml

.redocly.lint-ignore.yaml

Lines changed: 387 additions & 0 deletions
Large diffs are not rendered by default.

.redocly.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends:
2+
- recommended
3+
rules:
4+
operation-4xx-response: off
5+
no-enum-type-mismatch: off
6+
no-unused-components: off
7+
struct: off

CHANGELOG.md

Lines changed: 87 additions & 41 deletions
Large diffs are not rendered by default.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"dev-3.4": "3.4.x-dev",
5151
"dev-4.1": "4.1.x-dev",
5252
"dev-4.2": "4.2.x-dev",
53-
"dev-main": "4.3.x-dev"
53+
"dev-main": "4.4.x-dev"
5454
},
5555
"symfony": {
5656
"require": "^6.4 || ^7.1 || ^8.0"

phpunit.baseline.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</line>
3232
</file>
3333
<file path="src/Metadata/Resource/Factory/MetadataCollectionFactoryTrait.php">
34-
<line number="249" hash="29843c95ea9de65e8e7867216969c55e2c33d9e2">
34+
<line number="252" hash="29843c95ea9de65e8e7867216969c55e2c33d9e2">
3535
<issue><![CDATA[Since api-platform/core 4.2: Having multiple "#[ApiResource]" attributes with the same "shortName" "SecuredDummy" on class "ApiPlatform\Tests\Fixtures\TestBundle\Entity\SecuredDummy" is deprecated and will result in automatic short name deduplication in API Platform 5.x. Set "defaults.extra_properties.deduplicate_resource_short_names" to "true" in the API Platform configuration to enable it now.]]></issue>
3636
<issue><![CDATA[Since api-platform/core 4.2: Having multiple "#[ApiResource]" attributes with the same "shortName" "RelatedDummy" on class "ApiPlatform\Tests\Fixtures\TestBundle\Entity\RelatedDummy" is deprecated and will result in automatic short name deduplication in API Platform 5.x. Set "defaults.extra_properties.deduplicate_resource_short_names" to "true" in the API Platform configuration to enable it now.]]></issue>
3737
<issue><![CDATA[Since api-platform/core 4.2: Having multiple "#[ApiResource]" attributes with the same "shortName" "Question" on class "ApiPlatform\Tests\Fixtures\TestBundle\Entity\Question" is deprecated and will result in automatic short name deduplication in API Platform 5.x. Set "defaults.extra_properties.deduplicate_resource_short_names" to "true" in the API Platform configuration to enable it now.]]></issue>

src/Doctrine/Common/Filter/BackedEnumFilterTrait.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@ public function getDescription(string $resourceClass): array
6060
$isCollection = str_ends_with($filterParameterName, '[]');
6161

6262
$enumValues = array_map(static fn (\BackedEnum $case) => $case->value, $this->enumTypes[$property]::cases());
63+
$enumType = \is_int($enumValues[0] ?? null) ? 'integer' : 'string';
6364

6465
$schema = $isCollection
65-
? ['type' => 'array', 'items' => ['type' => 'string', 'enum' => $enumValues]]
66-
: ['type' => 'string', 'enum' => $enumValues];
66+
? ['type' => 'array', 'items' => ['type' => $enumType, 'enum' => $enumValues]]
67+
: ['type' => $enumType, 'enum' => $enumValues];
6768

6869
$description[$filterParameterName] = [
6970
'property' => $propertyName,
70-
'type' => 'string',
71+
'type' => $enumType,
7172
'required' => false,
7273
'is_collection' => $isCollection,
7374
'schema' => $schema,

src/Doctrine/Common/Filter/OpenApiFilterTrait.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|arr
2828
return new OpenApiParameter(name: $parameter->getKey(), in: 'query');
2929
}
3030

31-
$arraySchema = ['type' => 'array', 'items' => $schema ?? ['type' => 'string']];
31+
if ('array' === ($schema['type'] ?? null)) {
32+
$arraySchema = $schema;
33+
} else {
34+
$arraySchema = ['type' => 'array', 'items' => $schema ?? ['type' => 'string']];
35+
}
3236

3337
return new OpenApiParameter(name: $parameter->getKey().'[]', in: 'query', style: 'deepObject', explode: true, schema: $arraySchema);
3438
}

src/Doctrine/Common/composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
},
6262
"extra": {
6363
"branch-alias": {
64-
"dev-main": "4.3.x-dev",
64+
"dev-main": "4.4.x-dev",
6565
"dev-4.2": "4.2.x-dev",
6666
"dev-3.4": "3.4.x-dev",
6767
"dev-4.1": "4.1.x-dev"
@@ -76,5 +76,7 @@
7676
},
7777
"scripts": {
7878
"test": "./vendor/bin/phpunit"
79-
}
79+
},
80+
"minimum-stability": "beta",
81+
"prefer-stable": true
8082
}

0 commit comments

Comments
 (0)