Skip to content

Commit 002c8b2

Browse files
committed
Merge 3.2
2 parents 6606dd4 + b1b4f14 commit 002c8b2

Some content is hidden

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

41 files changed

+555
-126
lines changed

CHANGELOG.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## v3.2.4
4+
5+
### Bug fixes
6+
7+
* [436921f3b](https://github.com/api-platform/core/commit/436921f3bfb15f77f3d6f9c7462df7882120cd37) fix(serializer): json violation list normalizer (#5941)
8+
9+
## v3.2.3
10+
11+
### Bug fixes
12+
13+
* [0f015214c](https://github.com/api-platform/core/commit/0f015214c311c31f4065d3c4b3c171c3152a4e64) fix(symfony): 404 wrongly normalized (#5936)
14+
* [495f75f81](https://github.com/api-platform/core/commit/495f75f811aedee491e3e419ca9d7040aea7355c) fix(serializer): json non-resource intermitent class (#5937)
15+
316
## v3.2.2
417

518
### Bug fixes
@@ -1892,4 +1905,4 @@ Please read #2825 if you have issues with the behavior of Readable/Writable Link
18921905
## 1.0.0 beta 2
18931906
18941907
* Preserve indexes when normalizing and denormalizing associative arrays
1895-
* Allow setting default order for property when registering a `Doctrine\Orm\Filter\OrderFilter` instance
1908+
* Allow setting default order for property when registering a `Doctrine\Orm\Filter\OrderFilter` instance

features/issues/5926.feature

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Feature: Issue 5926
2+
In order to reproduce the issue at https://github.com/api-platform/core/issues/5926
3+
As a client software developer
4+
I need to be able to use every operation on a resource with non-resources embed objects
5+
6+
@!mongodb
7+
Scenario: Create and retrieve a WriteResource
8+
When I add "Accept" header equal to "application/json"
9+
And I send a "GET" request to "/test_issue5926s/1"
10+
Then the response status code should be 200
11+
And the response should be in JSON
12+
And the header "Content-Type" should be equal to "application/json; charset=utf-8"

features/main/validation.feature

+31
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,34 @@ Feature: Using validations groups
157157
]
158158
}
159159
"""
160+
161+
@!mongodb
162+
Scenario: Get violations constraints
163+
When I add "Accept" header equal to "application/json"
164+
And I add "Content-Type" header equal to "application/json"
165+
And I send a "POST" request to "/issue5912s" with body:
166+
"""
167+
{
168+
"title": ""
169+
}
170+
"""
171+
Then the response status code should be 422
172+
And the response should be in JSON
173+
And the JSON should be equal to:
174+
"""
175+
{
176+
"status": 422,
177+
"violations": [
178+
{
179+
"propertyPath": "title",
180+
"message": "This value should not be blank.",
181+
"code": "c1051bb4-d103-4f74-8988-acbcafc7fdc3"
182+
}
183+
],
184+
"detail": "title: This value should not be blank.",
185+
"type": "/validation_errors/c1051bb4-d103-4f74-8988-acbcafc7fdc3",
186+
"title": "An error occurred"
187+
}
188+
"""
189+
And the header "Content-Type" should be equal to "application/problem+json; charset=utf-8"
190+

src/Doctrine/Odm/Filter/BooleanFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
*
2424
* Syntax: `?property=<true|false|1|0>`.
2525
*
26-
* <CodeSelector>
26+
* <div data-code-selector>
27+
*
2728
* ```php
2829
* <?php
2930
* // api/src/Entity/Book.php
@@ -94,7 +95,8 @@
9495
* </resource>
9596
* </resources>
9697
* ```
97-
* </CodeSelector>
98+
*
99+
* </div>
98100
*
99101
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?published=true`.
100102
*

src/Doctrine/Odm/Filter/DateFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
* - Consider items as youngest: use `ApiPlatform\Doctrine\Odm\Filter\DateFilter::INCLUDE_NULL_AFTER` (`include_null_after`) strategy
3737
* - Always include items: use `ApiPlatform\Doctrine\Odm\Filter\DateFilter::INCLUDE_NULL_BEFORE_AND_AFTER` (`include_null_before_and_after`) strategy
3838
*
39-
* <CodeSelector>
39+
* <div data-code-selector>
40+
*
4041
* ```php
4142
* <?php
4243
* // api/src/Entity/Book.php
@@ -107,7 +108,8 @@
107108
* </resource>
108109
* </resources>
109110
* ```
110-
* </CodeSelector>
111+
*
112+
* </div>
111113
*
112114
* Given that the collection endpoint is `/books`, you can filter books by date with the following query: `/books?createdAt[after]=2018-03-19`.
113115
*

src/Doctrine/Odm/Filter/ExistsFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
*
2828
* Syntax: `?exists[property]=<true|false|1|0>`.
2929
*
30-
* <CodeSelector>
30+
* <div data-code-selector>
31+
*
3132
* ```php
3233
* <?php
3334
* // api/src/Entity/Book.php
@@ -98,7 +99,8 @@
9899
* </resource>
99100
* </resources>
100101
* ```
101-
* </CodeSelector>
102+
*
103+
* </div>
102104
*
103105
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?exists[comment]=true`.
104106
*

src/Doctrine/Odm/Filter/NumericFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
*
2424
* Syntax: `?property=<int|bigint|decimal...>`.
2525
*
26-
* <CodeSelector>
26+
* <div data-code-selector>
27+
*
2728
* ```php
2829
* <?php
2930
* // api/src/Entity/Book.php
@@ -94,7 +95,8 @@
9495
* </resource>
9596
* </resources>
9697
* ```
97-
* </CodeSelector>
98+
*
99+
* </div>
98100
*
99101
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?price=10`.
100102
*

src/Doctrine/Odm/Filter/OrderFilter.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
*
2727
* Syntax: `?order[property]=<asc|desc>`.
2828
*
29-
* <CodeSelector>
29+
* <div data-code-selector>
30+
*
3031
* ```php
3132
* <?php
3233
* // api/src/Entity/Book.php
@@ -100,13 +101,15 @@
100101
* </resource>
101102
* </resources>
102103
* ```
103-
* </CodeSelector>
104+
*
105+
* </div>
104106
*
105107
* Given that the collection endpoint is `/books`, you can filter books by title in ascending order and then by ID in descending order with the following query: `/books?order[title]=desc&order[id]=asc`.
106108
*
107109
* By default, whenever the query does not specify the direction explicitly (e.g.: `/books?order[title]&order[id]`), filters will not be applied unless you configure a default order direction to use:
108110
*
109-
* <CodeSelector>
111+
* <div data-code-selector>
112+
*
110113
* ```php
111114
* <?php
112115
* // api/src/Entity/Book.php
@@ -179,7 +182,8 @@
179182
* </resource>
180183
* </resources>
181184
* ```
182-
* </CodeSelector>
185+
*
186+
* </div>
183187
*
184188
* When the property used for ordering can contain `null` values, you may want to specify how `null` values are treated in the comparison:
185189
* - Use the default behavior of the DBMS: use `null` strategy

src/Doctrine/Odm/Filter/RangeFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
*
2424
* Syntax: `?property[<lt|gt|lte|gte|between>]=value`.
2525
*
26-
* <CodeSelector>
26+
* <div data-code-selector>
27+
*
2728
* ```php
2829
* <?php
2930
* // api/src/Entity/Book.php
@@ -95,7 +96,8 @@
9596
* </resource>
9697
* </resources>
9798
* ```
98-
* </CodeSelector>
99+
*
100+
* </div>
99101
*
100102
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?price[between]=12.99..15.99`.
101103
*

src/Doctrine/Odm/Filter/SearchFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
*
5757
* Syntax: `?property[]=foo&property[]=bar`.
5858
*
59-
* <CodeSelector>
59+
* <div data-code-selector>
60+
*
6061
* ```php
6162
* <?php
6263
* // api/src/Entity/Book.php
@@ -129,7 +130,8 @@
129130
* </resource>
130131
* </resources>
131132
* ```
132-
* </CodeSelector>
133+
*
134+
* </div>
133135
*
134136
* @author Kévin Dunglas <[email protected]>
135137
* @author Alan Poulain <[email protected]>

src/Doctrine/Orm/Filter/BooleanFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*
2626
* Syntax: `?property=<true|false|1|0>`.
2727
*
28-
* <CodeSelector>
28+
* <div data-code-selector>
29+
*
2930
* ```php
3031
* <?php
3132
* // api/src/Entity/Book.php
@@ -97,7 +98,8 @@
9798
* </resource>
9899
* </resources>
99100
* ```
100-
* </CodeSelector>
101+
*
102+
* </div>
101103
*
102104
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?published=true`.
103105
*

src/Doctrine/Orm/Filter/DateFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
* - Consider items as youngest: use `ApiPlatform\Doctrine\Orm\Filter\DateFilter::INCLUDE_NULL_AFTER` (`include_null_after`) strategy
4040
* - Always include items: use `ApiPlatform\Doctrine\Orm\Filter\DateFilter::INCLUDE_NULL_BEFORE_AND_AFTER` (`include_null_before_and_after`) strategy
4141
*
42-
* <CodeSelector>
42+
* <div data-code-selector>
43+
*
4344
* ```php
4445
* <?php
4546
* // api/src/Entity/Book.php
@@ -111,7 +112,8 @@
111112
* </resource>
112113
* </resources>
113114
* ```
114-
* </CodeSelector>
115+
*
116+
* </div>
115117
*
116118
* Given that the collection endpoint is `/books`, you can filter books by date with the following query: `/books?createdAt[after]=2018-03-19`.
117119
*

src/Doctrine/Orm/Filter/ExistsFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
*
3131
* Syntax: `?exists[property]=<true|false|1|0>`.
3232
*
33-
* <CodeSelector>
33+
* <div data-code-selector>
34+
*
3435
* ```php
3536
* <?php
3637
* // api/src/Entity/Book.php
@@ -102,7 +103,8 @@
102103
* </resource>
103104
* </resources>
104105
* ```
105-
* </CodeSelector>
106+
*
107+
* </div>
106108
*
107109
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?exists[comment]=true`.
108110
*

src/Doctrine/Orm/Filter/NumericFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*
2626
* Syntax: `?property=<int|bigint|decimal...>`.
2727
*
28-
* <CodeSelector>
28+
* <div data-code-selector>
29+
*
2930
* ```php
3031
* <?php
3132
* // api/src/Entity/Book.php
@@ -97,7 +98,8 @@
9798
* </resource>
9899
* </resources>
99100
* ```
100-
* </CodeSelector>
101+
*
102+
* </div>
101103
*
102104
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?price=10`.
103105
*

src/Doctrine/Orm/Filter/OrderFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
*
2929
* Syntax: `?order[property]=<asc|desc>`.
3030
*
31-
* <CodeSelector>
31+
* <div data-code-selector>
32+
*
3233
* ```php
3334
* <?php
3435
* // api/src/Entity/Book.php
@@ -102,7 +103,8 @@
102103
* </resource>
103104
* </resources>
104105
* ```
105-
* </CodeSelector>
106+
*
107+
* </div>
106108
*
107109
* Given that the collection endpoint is `/books`, you can filter books by title in ascending order and then by ID in descending order with the following query: `/books?order[title]=desc&order[id]=asc`.
108110
*

src/Doctrine/Orm/Filter/RangeFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*
2626
* Syntax: `?property[<lt|gt|lte|gte|between>]=value`.
2727
*
28-
* <CodeSelector>
28+
* <div data-code-selector>
29+
*
2930
* ```php
3031
* <?php
3132
* // api/src/Entity/Book.php
@@ -97,7 +98,8 @@
9798
* </resource>
9899
* </resources>
99100
* ```
100-
* </CodeSelector>
101+
*
102+
* </div>
101103
*
102104
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?price[between]=12.99..15.99`.
103105
*

src/Doctrine/Orm/Filter/SearchFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
*
5757
* Syntax: `?property[]=foo&property[]=bar`.
5858
*
59-
* <CodeSelector>
59+
* <div data-code-selector>
60+
*
6061
* ```php
6162
* <?php
6263
* // api/src/Entity/Book.php
@@ -129,7 +130,8 @@
129130
* </resource>
130131
* </resources>
131132
* ```
132-
* </CodeSelector>
133+
*
134+
* </div>
133135
*
134136
* @author Kévin Dunglas <[email protected]>
135137
*/

src/Elasticsearch/Filter/MatchFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
*
1919
* Syntax: `?property[]=value`.
2020
*
21-
* <CodeSelector>
21+
* <div data-code-selector>
22+
*
2223
* ```php
2324
* <?php
2425
* // api/src/Entity/Book.php
@@ -90,7 +91,8 @@
9091
* </resource>
9192
* </resources>
9293
* ```
93-
* </CodeSelector>
94+
*
95+
* </div>
9496
*
9597
* Given that the collection endpoint is `/books`, you can filter books by title content with the following query: `/books?title=Foundation`.
9698
*

0 commit comments

Comments
 (0)