@@ -42,13 +42,12 @@ Feature: Error handling
4242 """
4343 Then the response status code should be 400
4444 And the response should be in JSON
45- And the header "Content-Type" should be equal to "application/problem +json; charset=utf-8"
45+ And the header "Content-Type" should be equal to "application/ld +json; charset=utf-8"
4646 And the JSON node "@context" should be equal to "/contexts/Error"
4747 And the JSON node "@type" should be equal to "hydra:Error"
4848 And the JSON node "hydra:title" should be equal to "An error occurred"
4949 And the JSON node "hydra:description" should be equal to 'Nested documents for attribute "relatedDummy" are not allowed. Use IRIs instead.'
5050 And the JSON node "trace" should exist
51- And the header "Link" should contain '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error"'
5251
5352 Scenario : Get an error during deserialization of collection
5453 When I add "Content-Type" header equal to "application/ld+json"
@@ -63,7 +62,7 @@ Feature: Error handling
6362 """
6463 Then the response status code should be 400
6564 And the response should be in JSON
66- And the header "Content-Type" should be equal to "application/problem +json; charset=utf-8"
65+ And the header "Content-Type" should be equal to "application/ld +json; charset=utf-8"
6766 And the JSON node "@context" should be equal to "/contexts/Error"
6867 And the JSON node "@type" should be equal to "hydra:Error"
6968 And the JSON node "hydra:title" should be equal to "An error occurred"
@@ -80,7 +79,7 @@ Feature: Error handling
8079 """
8180 Then the response status code should be 400
8281 And the response should be in JSON
83- And the header "Content-Type" should be equal to "application/problem +json; charset=utf-8"
82+ And the header "Content-Type" should be equal to "application/ld +json; charset=utf-8"
8483 And the JSON node "@context" should be equal to "/contexts/Error"
8584 And the JSON node "@type" should be equal to "hydra:Error"
8685 And the JSON node "hydra:title" should be equal to "An error occurred"
@@ -98,7 +97,7 @@ Feature: Error handling
9897 """
9998 Then the response status code should be 400
10099 And the response should be in JSON
101- And the header "Content-Type" should be equal to "application/problem +json; charset=utf-8"
100+ And the header "Content-Type" should be equal to "application/ld +json; charset=utf-8"
102101 And the JSON node "@context" should be equal to "/contexts/Error"
103102 And the JSON node "@type" should be equal to "hydra:Error"
104103 And the JSON node "hydra:title" should be equal to "An error occurred"
@@ -152,3 +151,39 @@ Feature: Error handling
152151 Then the response status code should be 201
153152 And the response should be in JSON
154153 And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
154+
155+ Scenario : Get an rfc 7807 validation error
156+ When I add "Content-Type" header equal to "application/ld+json"
157+ And I send a "POST" request to "/validation_exception_problems" with body:
158+ """
159+ {}
160+ """
161+ Then the response status code should be 422
162+ And the response should be in JSON
163+ And the header "Content-Type" should be equal to "application/problem+json; charset=utf-8"
164+ And the header "Link" should contain '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error"'
165+ And the JSON node "@context" should not exist
166+
167+ Scenario : Get an rfc 7807 error
168+ When I add "Content-Type" header equal to "application/ld+json"
169+ And I send a "POST" request to "/exception_problems" with body:
170+ """
171+ {}
172+ """
173+ Then the response status code should be 400
174+ And the response should be in JSON
175+ And the header "Content-Type" should be equal to "application/problem+json; charset=utf-8"
176+ And the header "Link" should contain '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error"'
177+ And the JSON node "@context" should not exist
178+
179+ Scenario : Get an rfc 7807 error with backward compatibility
180+ When I add "Content-Type" header equal to "application/ld+json"
181+ And I send a "POST" request to "/exception_problems_with_compatibility" with body:
182+ """
183+ {}
184+ """
185+ Then the response status code should be 400
186+ And the response should be in JSON
187+ And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
188+ And the header "Link" should not contain '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error"'
189+ And the JSON node "@context" should exist
0 commit comments