Skip to content

Commit e27e567

Browse files
committed
fix: retro-compatibility with bc flag
METADATA_BACKWARD_COMPATIBILITY_LAYER
1 parent 21d1f54 commit e27e567

File tree

219 files changed

+3799
-1299
lines changed

Some content is hidden

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

219 files changed

+3799
-1299
lines changed

features/graphql/mutation.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ Feature: GraphQL mutation support
663663
And the JSON node "data.createDummyGroup.clientMutationId" should be equal to "myId"
664664

665665
@createSchema
666+
@v3
666667
Scenario: Use serialization groups with relations
667668
Given there is 1 dummy object with relatedDummy and its thirdLevel
668669
And there is a RelatedDummy with 2 friends
@@ -700,6 +701,7 @@ Feature: GraphQL mutation support
700701
}
701702
}
702703
"""
704+
Then print last JSON response
703705
Then the response status code should be 200
704706
And the response should be in JSON
705707
And the header "Content-Type" should be equal to "application/json"

features/json/input_output.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Feature: JSON DTO input and output
77
Given I add "Accept" header equal to "application/json"
88
And I add "Content-Type" header equal to "application/json"
99

10+
@createSchema
1011
Scenario: Request a password reset
1112
And I send a "POST" request to "/users/password_reset_request" with body:
1213
"""
@@ -24,6 +25,7 @@ Feature: JSON DTO input and output
2425
}
2526
"""
2627

28+
@createSchema
2729
Scenario: Request a password reset for a non-existent user
2830
And I send a "POST" request to "/users/password_reset_request" with body:
2931
"""

features/main/attribute_resource.feature

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Feature: Resource attributes
44
I should be able to fetch data from a state provider
55

66
@php8
7+
@v3
78
@!mysql
89
@!mongodb
910
Scenario: Retrieve a Resource collection
@@ -36,6 +37,7 @@ Feature: Resource attributes
3637
"""
3738

3839
@php8
40+
@v3
3941
@!mysql
4042
@!mongodb
4143
Scenario: Retrieve the first resource
@@ -56,6 +58,7 @@ Feature: Resource attributes
5658
"""
5759

5860
@php8
61+
@v3
5962
@!mysql
6063
@!mongodb
6164
Scenario: Retrieve the aliased resource
@@ -78,6 +81,7 @@ Feature: Resource attributes
7881
"""
7982

8083
@php8
84+
@v3
8185
@!mysql
8286
@!mongodb
8387
Scenario: Patch the aliased resource

features/main/crud.feature

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ Feature: Create-Retrieve-Update-Delete
560560
And the response should be empty
561561

562562
@php8
563+
@v3
563564
@createSchema
564565
Scenario: Create a resource ProcessorEntity
565566
When I add "Content-Type" header equal to "application/ld+json"
@@ -586,6 +587,7 @@ Feature: Create-Retrieve-Update-Delete
586587
"""
587588

588589
@php8
590+
@v3
589591
Scenario: Create a resource ProviderEntity
590592
When I add "Content-Type" header equal to "application/ld+json"
591593
And I send a "POST" request to "/provider_entities" with body:
@@ -611,6 +613,7 @@ Feature: Create-Retrieve-Update-Delete
611613
"""
612614

613615
@php8
616+
@v3
614617
Scenario: Get a collection of Provider Entities
615618
When I send a "GET" request to "/provider_entities"
616619
Then the response status code should be 200
@@ -635,6 +638,7 @@ Feature: Create-Retrieve-Update-Delete
635638
"""
636639

637640
@php8
641+
@v3
638642
Scenario: Get a resource ProviderEntity
639643
When I send a "GET" request to "/provider_entities/1"
640644
Then the response status code should be 200

features/main/crud_uri_variables.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Feature: Uri Variables
22

33
@createSchema
44
@php8
5+
@v3
56
Scenario: Create a resource Company
67
When I add "Content-Type" header equal to "application/ld+json"
78
And I send a "POST" request to "/companies" with body:
@@ -28,6 +29,7 @@ Feature: Uri Variables
2829
"""
2930

3031
@php8
32+
@v3
3133
Scenario: Create a second resource Company
3234
When I add "Content-Type" header equal to "application/ld+json"
3335
And I send a "POST" request to "/companies" with body:
@@ -39,6 +41,7 @@ Feature: Uri Variables
3941
Then the response status code should be 201
4042

4143
@php8
44+
@v3
4245
Scenario: Create first Employee
4346
When I add "Content-Type" header equal to "application/ld+json"
4447
And I send a "POST" request to "/employees" with body:
@@ -66,6 +69,7 @@ Feature: Uri Variables
6669
"""
6770

6871
@php8
72+
@v3
6973
Scenario: Create second Employee
7074
When I add "Content-Type" header equal to "application/ld+json"
7175
And I send a "POST" request to "/employees" with body:
@@ -78,6 +82,7 @@ Feature: Uri Variables
7882
Then the response status code should be 201
7983

8084
@php8
85+
@v3
8186
Scenario: Create third Employee
8287
When I add "Content-Type" header equal to "application/ld+json"
8388
And I send a "POST" request to "/employees" with body:
@@ -90,6 +95,7 @@ Feature: Uri Variables
9095
Then the response status code should be 201
9196

9297
@php8
98+
@v3
9399
Scenario: Retrieve the collection of employees
94100
When I add "Content-Type" header equal to "application/ld+json"
95101
And I send a "GET" request to "/companies/2/employees"
@@ -152,6 +158,7 @@ Feature: Uri Variables
152158
And the JSON node "data.companies.edges[1].node.employees.edges[1].node.name" should be equal to "foo3"
153159

154160
@php8
161+
@v3
155162
Scenario: Retrieve the company of an employee
156163
When I add "Content-Type" header equal to "application/ld+json"
157164
And I send a "GET" request to "/employees/1/company"
@@ -171,6 +178,7 @@ Feature: Uri Variables
171178
"""
172179

173180
@php8
181+
@v3
174182
Scenario: Retrieve an employee
175183
When I add "Content-Type" header equal to "application/ld+json"
176184
And I send a "GET" request to "/companies/1/employees/1"
@@ -190,6 +198,7 @@ Feature: Uri Variables
190198
"""
191199

192200
@php8
201+
@v3
193202
Scenario: Trying to get an employee of wrong company
194203
When I add "Content-Type" header equal to "application/ld+json"
195204
And I send a "GET" request to "/companies/1/employees/2"

features/main/operation_resource.feature

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Feature: Resource operations
44
I should be able to persist data from a processor
55

66
@php8
7+
@v3
78
@createSchema
89
@!mongodb
910
Scenario: Create an operation resource
@@ -19,6 +20,7 @@ Feature: Resource operations
1920
Then the response status code should be 201
2021

2122
@php8
23+
@v3
2224
@!mongodb
2325
Scenario: Patch an operation resource
2426
When I add "Content-Type" header equal to "application/merge-patch+json"
@@ -41,6 +43,7 @@ Feature: Resource operations
4143
"""
4244

4345
@php8
46+
@v3
4447
@!mongodb
4548
Scenario: Update an operation resource
4649
When I add "Content-Type" header equal to "application/ld+json"

src/Action/EntrypointAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace ApiPlatform\Action;
1515

1616
use ApiPlatform\Api\Entrypoint;
17-
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceNameCollectionFactoryInterface;
17+
use ApiPlatform\Metadata\Resource\Factory\ResourceNameCollectionFactoryInterface;
1818

1919
/**
2020
* Generates the API entrypoint.

src/Api/Entrypoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace ApiPlatform\Api;
1515

16-
use ApiPlatform\Core\Metadata\Resource\ResourceNameCollection;
16+
use ApiPlatform\Metadata\Resource\ResourceNameCollection;
1717

1818
/**
1919
* The first path you will see in the API.

src/Api/IdentifiersExtractor.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace ApiPlatform\Api;
1515

1616
use ApiPlatform\Core\Identifier\CompositeIdentifierParser;
17+
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface as LegacyPropertyMetadataFactoryInterface;
1718
use ApiPlatform\Exception\RuntimeException;
1819
use ApiPlatform\Metadata\GraphQl\Operation as GraphQlOperation;
1920
use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
@@ -33,10 +34,13 @@ final class IdentifiersExtractor implements IdentifiersExtractorInterface
3334
use ResourceClassInfoTrait;
3435

3536
private $propertyNameCollectionFactory;
37+
/**
38+
* @var LegacyPropertyMetadataFactoryInterface|PropertyMetadataFactoryInterface
39+
*/
3640
private $propertyMetadataFactory;
3741
private $propertyAccessor;
3842

39-
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory, ResourceClassResolverInterface $resourceClassResolver, PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, PropertyAccessorInterface $propertyAccessor = null)
43+
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory, ResourceClassResolverInterface $resourceClassResolver, PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, $propertyMetadataFactory, PropertyAccessorInterface $propertyAccessor = null)
4044
{
4145
$this->resourceMetadataFactory = $resourceMetadataFactory;
4246
$this->resourceClassResolver = $resourceClassResolver;

src/Api/ResourceClassResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
namespace ApiPlatform\Api;
1515

16-
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceNameCollectionFactoryInterface;
1716
use ApiPlatform\Exception\InvalidArgumentException;
17+
use ApiPlatform\Metadata\Resource\Factory\ResourceNameCollectionFactoryInterface;
1818
use ApiPlatform\Util\ClassInfoTrait;
1919

2020
/**

0 commit comments

Comments
 (0)