Merge branch '2.6' into merge-2.6 · mega/api-platform-core@55757e8 · GitHub
Skip to content

Commit 55757e8

Browse files
committed
Merge branch '2.6' into merge-2.6
2 parents a917886 + 4e22a28 commit 55757e8

41 files changed

Lines changed: 691 additions & 655 deletions

Some content is hidden

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

‎.github/workflows/ci.yml‎

Lines changed: 5 additions & 3 deletions

‎CHANGELOG.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,24 @@
3333

3434
## 2.6.5
3535

36-
* JsonSchema: Update Hydra `@context` property possible types
36+
* Fix various usage of various deprecated methods
37+
* JsonSchema: Update Hydra `@context` property possible types (#4223)
38+
* JsonSchema: Add hydra:previous` to the `hydra:view` schema properties (#4310)
3739
* Filter validation: Fix issue in Required filter validator with dot notation (#4221)
3840
* OpenAPI: Fix notice/warning for `response` without `content` in the `openapi_context` (#4210)
3941
* OpenAPI: Do not use output for request body (#4213)
40-
* OpenAPI: Do not use jsonld schema for all media types (#4247) (BC note: `SchemaFactory::buildSchema()` is now immutable as it no longer modifies the passed `$schema`)
42+
* OpenAPI: Do not use JSON-lD schema for all media types (#4247) (BC note: `SchemaFactory::buildSchema()` is now immutable as it no longer modifies the passed `$schema`)
43+
* OpenAPI: Allow setting extensionProperties with YAML schema definition (#4228)
44+
* OpenAPI: do not throw error with non-standard HTTP verb (#4304)
4145
* Serializer: Convert internal error to HTTP 400 in Ramsey uuid denormalization from invalid body string (#4200)
42-
* Symfony: Add tests with Symfony Uuid (#4230)
43-
* OpenAPI: Allow to set extensionProperties with YAML schema definition (#4228)
4446
* GraphQL: Fix `FieldsBuilder` not fully unwrapping nested types before deciding if a resolver is needed (#4251)
4547
* GraphQL: Do not use a resolver for the nested payload of a mutation or subscription (#4289)
48+
* GraphQL: Allow search filter to use an int for its value (#4295)
49+
* Varnish: Improve `BAN` regex performance (#4231)
50+
* MongoDB: Fix denormalization of properties with embeds many that omit target document directive (#4315)
51+
* MongoDB: Fix resolving proxy class in class metadata factory (#4322)
52+
* Test: Add `withOptions()` to our HttpClient implementation (#4282)
53+
* Metadata: Fix allow using constants in XML configuration (resource attribute) (#4321)
4654

4755
## 2.6.4
4856

‎composer.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"authors": [
99
{
1010
"name": "Kévin Dunglas",
11-
"email": "dunglas@gmail.com",
11+
"email": "kevin@dunglas.fr",
1212
"homepage": "https://dunglas.fr"
1313
}
1414
],
@@ -30,6 +30,7 @@
3030
"behat/behat": "^3.1",
3131
"behat/mink": "^1.7",
3232
"doctrine/annotations": "^1.7",
33+
"doctrine/cache": "^1.11",
3334
"doctrine/common": "^2.11 || ^3.0",
3435
"doctrine/data-fixtures": "^1.2.2",
3536
"doctrine/doctrine-bundle": "^1.12 || ^2.0",
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
@mongodb
2+
Feature: Embed many without target document deserializable
3+
In order to create and update resources
4+
As a developer
5+
I need to be able to deserialize data into objects with embed many that omit target document directive
6+
7+
@createSchema
8+
Scenario: Post a resource with embedded data
9+
When I add "Content-Type" header equal to "application/ld+json"
10+
And I send a "POST" request to "/dummy_with_embed_many_omitting_target_documents" with body:
11+
"""
12+
{
13+
"embeddedDummies": [
14+
{
15+
"dummyName": "foo",
16+
"dummyBoolean": true,
17+
"dummyDate": "2020-01-01",
18+
"dummyFloat": 0.1,
19+
"dummyPrice": 10
20+
},
21+
{
22+
"dummyName": "bar",
23+
"dummyBoolean": false,
24+
"dummyDate": "2021-01-01",
25+
"dummyFloat": 0.2,
26+
"dummyPrice": 20
27+
}
28+
]
29+
}
30+
"""
31+
Then the response status code should be 201
32+
And the response should be in JSON
33+
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
34+
And the JSON should be a superset of:
35+
"""
36+
{
37+
"@context": "/contexts/DummyWithEmbedManyOmittingTargetDocument",
38+
"@id": "/dummy_with_embed_many_omitting_target_documents/1",
39+
"@type": "DummyWithEmbedManyOmittingTargetDocument",
40+
"id": 1,
41+
"embeddedDummies": [
42+
{
43+
"@type": "EmbeddableDummy",
44+
"dummyName": "foo",
45+
"dummyBoolean": true,
46+
"dummyDate": "2020-01-01T00:00:00+00:00",
47+
"dummyFloat": 0.1,
48+
"dummyPrice": 10
49+
},
50+
{
51+
"@type": "EmbeddableDummy",
52+
"dummyName": "bar",
53+
"dummyBoolean": false,
54+
"dummyDate": "2021-01-01T00:00:00+00:00",
55+
"dummyFloat": 0.2,
56+
"dummyPrice": 20
57+
}
58+
]
59+
}
60+
"""

‎features/openapi/docs.feature‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ Feature: Documentation support
146146
"type": "string",
147147
"format": "iri-reference"
148148
},
149+
"hydra:previous": {
150+
"type": "string",
151+
"format": "iri-reference"
152+
},
149153
"hydra:next": {
150154
"type": "string",
151155
"format": "iri-reference"

‎src/Bridge/Doctrine/MongoDbOdm/PropertyInfo/DoctrineExtractor.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,13 @@ public function getTypes($class, $property, array $context = [])
6363
}
6464

6565
if ($metadata->hasAssociation($property)) {
66+
/** @var ?string $class */
6667
$class = $metadata->getAssociationTargetClass($property);
6768

69+
if (null === $class) {
70+
return null;
71+
}
72+
6873
if ($metadata->isSingleValuedAssociation($property)) {
6974
$nullable = $metadata instanceof MongoDbClassMetadata && $metadata->isNullable($property);
7075

‎src/Bridge/Symfony/Bundle/Resources/config/api.xml‎

Lines changed: 4 additions & 0 deletions
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)