Skip to content

Commit 06395ef

Browse files
committed
refactor: remove redundant "type" field from error responses in feature files
Spring Boot 4.x / Spring Framework 7 now follows RFC-7807 (Problem Details) and produces application/problem+json, which contains: title status detail instance There is no type field unless you explicitly set one.
1 parent 96379f0 commit 06395ef

7 files changed

Lines changed: 2 additions & 37 deletions

File tree

ff4j-spring-rest-api/src/test/kotlin/org/ff4j/spring/rest/api/resources/ff4j/FF4JResourceStepDef.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ class FF4JResourceStepDef(ff4j: FF4j, context: WebApplicationContext) : En {
110110
uriBuilder: UriBuilder,
111111
path: String,
112112
formParams: Map<String, String>
113-
): URI? {
114-
formParams.forEach { (name: String?, values: String?) ->
113+
): URI {
114+
formParams.forEach { (name: String, values: String) ->
115115
uriBuilder.queryParam(
116116
name,
117117
values

ff4j-spring-rest-api/src/test/resources/features/FF4JResource.feature

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ Feature:
6060
Then the user gets an error response with code "404" and error message as
6161
"""
6262
{
63-
"type": "about:blank",
6463
"title": "Not Found",
6564
"status": 404,
6665
"detail": "no security has been defined",
@@ -99,7 +98,6 @@ Feature:
9998
Then the user gets an error response with code "404" and error message as
10099
"""
101100
{
102-
"type": "about:blank",
103101
"title": "Not Found",
104102
"status": 404,
105103
"detail": "feature not found",
@@ -166,7 +164,6 @@ Feature:
166164
Then the user gets an error response with code "404" and error message as
167165
"""
168166
{
169-
"type": "about:blank",
170167
"title": "Not Found",
171168
"status": 404,
172169
"detail": "feature not found",
@@ -217,7 +214,6 @@ Feature:
217214
Then the user gets an error response with code "400" and error message as
218215
"""
219216
{
220-
"type": "about:blank",
221217
"title": "Bad Request",
222218
"status": 400,
223219
"detail": "bad request",

ff4j-spring-rest-api/src/test/resources/features/FeatureResource.feature

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Feature: FeatureResource
2020
Then the user gets an error response with code "404" and error message as
2121
"""
2222
{
23-
"type": "about:blank",
2423
"title": "Not Found",
2524
"status": 404,
2625
"detail": "feature not found",
@@ -49,7 +48,6 @@ Feature: FeatureResource
4948
Then the user gets an error response with code "400" and error message as
5049
"""
5150
{
52-
"type": "about:blank",
5351
"title": "Bad Request",
5452
"status": 400,
5553
"detail": "feature uid cannot be blank",
@@ -69,7 +67,6 @@ Feature: FeatureResource
6967
Then the user gets an error response with code "400" and error message as
7068
"""
7169
{
72-
"type": "about:blank",
7370
"title": "Bad Request",
7471
"status": 400,
7572
"detail": "feature uid did not match with the requested feature uid to be created or updated",
@@ -186,7 +183,6 @@ Feature: FeatureResource
186183
Then the user gets an error response with code "400" and error message as
187184
"""
188185
{
189-
"type": "about:blank",
190186
"title": "Bad Request",
191187
"status": 400,
192188
"detail": "flipping strategy specified wrongly",
@@ -233,7 +229,6 @@ Feature: FeatureResource
233229
Then the user gets an error response with code "400" and error message as
234230
"""
235231
{
236-
"type": "about:blank",
237232
"title": "Bad Request",
238233
"status": 400,
239234
"detail": "properties specified wrongly",
@@ -265,7 +260,6 @@ Feature: FeatureResource
265260
Then the user gets an error response with code "404" and error message as
266261
"""
267262
{
268-
"type": "about:blank",
269263
"title": "Not Found",
270264
"status": 404,
271265
"detail": "feature not found",
@@ -279,7 +273,6 @@ Feature: FeatureResource
279273
Then the user gets an error response with code "404" and error message as
280274
"""
281275
{
282-
"type": "about:blank",
283276
"title": "Not Found",
284277
"status": 404,
285278
"detail": "feature not found",
@@ -312,7 +305,6 @@ Feature: FeatureResource
312305
Then the user gets an error response with code "404" and error message as
313306
"""
314307
{
315-
"type": "about:blank",
316308
"title": "Not Found",
317309
"status": 404,
318310
"detail": "feature not found",
@@ -345,7 +337,6 @@ Feature: FeatureResource
345337
Then the user gets an error response with code "404" and error message as
346338
"""
347339
{
348-
"type": "about:blank",
349340
"title": "Not Found",
350341
"status": 404,
351342
"detail": "feature not found",
@@ -360,7 +351,6 @@ Feature: FeatureResource
360351
Then the user gets an error response with code "404" and error message as
361352
"""
362353
{
363-
"type": "about:blank",
364354
"title": "Not Found",
365355
"status": 404,
366356
"detail": "feature not found",
@@ -395,7 +385,6 @@ Feature: FeatureResource
395385
Then the user gets an error response with code "304" and error message as
396386
"""
397387
{
398-
"type": "about:blank",
399388
"title": "Not Modified",
400389
"status": 304,
401390
"detail": "role already exists",
@@ -421,7 +410,6 @@ Feature: FeatureResource
421410
Then the user gets an error response with code "404" and error message as
422411
"""
423412
{
424-
"type": "about:blank",
425413
"title": "Not Found",
426414
"status": 404,
427415
"detail": "feature not found",
@@ -456,7 +444,6 @@ Feature: FeatureResource
456444
Then the user gets an error response with code "404" and error message as
457445
"""
458446
{
459-
"type": "about:blank",
460447
"title": "Not Found",
461448
"status": 404,
462449
"detail": "role does not exist",
@@ -482,7 +469,6 @@ Feature: FeatureResource
482469
Then the user gets an error response with code "404" and error message as
483470
"""
484471
{
485-
"type": "about:blank",
486472
"title": "Not Found",
487473
"status": 404,
488474
"detail": "feature not found",
@@ -498,7 +484,6 @@ Feature: FeatureResource
498484
Then the user gets an error response with code "304" and error message as
499485
"""
500486
{
501-
"type": "about:blank",
502487
"title": "Not Modified",
503488
"status": 304,
504489
"detail": "group already exists",
@@ -543,7 +528,6 @@ Feature: FeatureResource
543528
Then the user gets an error response with code "404" and error message as
544529
"""
545530
{
546-
"type": "about:blank",
547531
"title": "Not Found",
548532
"status": 404,
549533
"detail": "feature not found",
@@ -578,7 +562,6 @@ Feature: FeatureResource
578562
Then the user gets an error response with code "404" and error message as
579563
"""
580564
{
581-
"type": "about:blank",
582565
"title": "Not Found",
583566
"status": 404,
584567
"detail": "group does not exist",

ff4j-spring-rest-api/src/test/resources/features/FeatureStoreResource.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ Feature: FeatureStoreResource
133133
Then the user gets an error response with code "404" and error message as
134134
"""
135135
{
136-
"type": "about:blank",
137136
"title": "Not Found",
138137
"status": 404,
139138
"detail": "feature store is not cached",
@@ -194,7 +193,6 @@ Feature: FeatureStoreResource
194193
Then the user gets an error response with code "404" and error message as
195194
"""
196195
{
197-
"type": "about:blank",
198196
"title": "Not Found",
199197
"status": 404,
200198
"detail": "feature store is not cached",

ff4j-spring-rest-api/src/test/resources/features/GroupResource.feature

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ Feature:
5151
Then the user gets an error response with code "404" and error message as
5252
"""
5353
{
54-
"type": "about:blank",
5554
"title": "Not Found",
5655
"status": 404,
5756
"detail": "group does not exist",
@@ -87,7 +86,6 @@ Feature:
8786
Then the user gets an error response with code "404" and error message as
8887
"""
8988
{
90-
"type": "about:blank",
9189
"title": "Not Found",
9290
"status": 404,
9391
"detail": "group does not exist",
@@ -123,7 +121,6 @@ Feature:
123121
Then the user gets an error response with code "404" and error message as
124122
"""
125123
{
126-
"type": "about:blank",
127124
"title": "Not Found",
128125
"status": 404,
129126
"detail": "group does not exist",

ff4j-spring-rest-api/src/test/resources/features/PropertyResource.feature

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Feature:
3434
Then the user gets an error response with code "404" and error message as
3535
"""
3636
{
37-
"type": "about:blank",
3837
"title": "Not Found",
3938
"status": 404,
4039
"detail": "property not found",
@@ -81,7 +80,6 @@ Feature:
8180
Then the user gets an error response with code "400" and error message as
8281
"""
8382
{
84-
"type": "about:blank",
8583
"title": "Bad Request",
8684
"status": 400,
8785
"detail": "property name cannot be blank",
@@ -103,7 +101,6 @@ Feature:
103101
Then the user gets an error response with code "400" and error message as
104102
"""
105103
{
106-
"type": "about:blank",
107104
"title": "Bad Request",
108105
"status": 400,
109106
"detail": "property name did not match with the requested property name to be created or updated",
@@ -144,7 +141,6 @@ Feature:
144141
Then the user gets an error response with code "404" and error message as
145142
"""
146143
{
147-
"type": "about:blank",
148144
"title": "Not Found",
149145
"status": 404,
150146
"detail": "property not found",
@@ -157,7 +153,6 @@ Feature:
157153
Then the user gets an error response with code "404" and error message as
158154
"""
159155
{
160-
"type": "about:blank",
161156
"title": "Not Found",
162157
"status": 404,
163158
"detail": "property not found",
@@ -186,7 +181,6 @@ Feature:
186181
Then the user gets an error response with code "404" and error message as
187182
"""
188183
{
189-
"type": "about:blank",
190184
"title": "Not Found",
191185
"status": 404,
192186
"detail": "property not found",
@@ -199,7 +193,6 @@ Feature:
199193
Then the user gets an error response with code "400" and error message as
200194
"""
201195
{
202-
"type": "about:blank",
203196
"title": "Bad Request",
204197
"status": 400,
205198
"detail": "bad request",

ff4j-spring-rest-api/src/test/resources/features/PropertyStoreResource.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ Feature:
9292
Then the user gets an error response with code "404" and error message as
9393
"""
9494
{
95-
"type": "about:blank",
9695
"title": "Not Found",
9796
"status": 404,
9897
"detail": "property store is not cached",
@@ -144,7 +143,6 @@ Feature:
144143
Then the user gets an error response with code "404" and error message as
145144
"""
146145
{
147-
"type": "about:blank",
148146
"title": "Not Found",
149147
"status": 404,
150148
"detail": "property store is not cached",

0 commit comments

Comments
 (0)