|
10 | 10 | 6. [General HTTP Stuff](#general-http-stuff) |
11 | 11 |
|
12 | 12 | ## Overview |
| 13 | + |
13 | 14 | This module overrides Spring Web's default (often minimal or plain-text) responses for many framework exceptions and |
14 | 15 | produces structured RFC 7807 `Problem` objects. [`ExceptionMappingConfiguration`][ExceptionMappingConfiguration] |
15 | 16 | registers these mappings. |
@@ -77,7 +78,7 @@ To extract values from target exception, it's possible to use placeholders for i |
77 | 78 |
|
78 | 79 | ```java |
79 | 80 | /** |
80 | | - * <pre>{@code |
| 81 | + * <pre>{@code |
81 | 82 | * { |
82 | 83 | * "type": "https://example.com/errors/invalid-request", |
83 | 84 | * "title": "Invalid Request", |
@@ -137,7 +138,9 @@ property `spring.validation.method.adapt-constraint-violations` to `true`. Enabl |
137 | 138 | not rely on raw `ConstraintViolationException`, but rather on `MethodValidationException`, which contains more details |
138 | 139 | about validated element. |
139 | 140 |
|
140 | | -Let's say we have following `@RestController`, where `idx` query param has different Java parameter name. |
| 141 | +Let's say we have following `@RestController`, where `customerId` query param has different Java parameter name (its |
| 142 | +`String customerIdParam`). We would like to have `customerId` in our response body as potential API clients do not have |
| 143 | +knowledge about internal technologies used by backend. |
141 | 144 |
|
142 | 145 | ```java |
143 | 146 | @Validated |
@@ -250,7 +253,7 @@ Example: |
250 | 253 | } |
251 | 254 | ``` |
252 | 255 | 5. If passing request that's too large by configuration, service will write following response. Note that reason phrase |
253 | | - for `413` was changed into `Content Too Large` in [RFC 9110 §15.5.14][rfc9110-15.5.4]. |
| 256 | + for `413` was changed into `Content Too Large` in [RFC 9110 §15.5.14][rfc9110-15.5.4]. |
254 | 257 | ```json |
255 | 258 | { |
256 | 259 | "status": 413, |
|
0 commit comments