You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/utilities/validation.md
+4-1
Original file line number
Diff line number
Diff line change
@@ -156,7 +156,10 @@ We support JSON schema version 4, 6, 7 and 201909 (from [jmespath-jackson librar
156
156
157
157
`@Validation` annotation is used to validate either inbound events or functions' response.
158
158
159
-
It will fail fast with `ValidationException` if an event or response doesn't conform with given JSON Schema.
159
+
It will fail fast if an event or response doesn't conform with given JSON Schema. For most type of events a `ValidationException` will be thrown.
160
+
For API gateway events associated with REST APIs and HTTP APIs - `APIGatewayProxyRequestEvent` and `APIGatewayV2HTTPEvent` - the `@Validation`
161
+
annotation will build and return a custom 400 / "Bad Request" response, with a body containing the validation errors. This saves you from having
162
+
to catch the validation exception and map it back to a meaningful user error yourself.
160
163
161
164
While it is easier to specify a json schema file in the classpath (using the notation `"classpath:/path/to/schema.json"`), you can also provide a JSON String containing the schema.
0 commit comments