Elffuss BraidHub

kikocis/EDC public

main · 1.5 KiBRenderedRawPermalink
1# Jersey
2
3This extension provides a `Jersey` implementation for the `WebService` service.
4
5## Configuration
6
7| Parameter name | Description | Default value |
8|---------------------------------------|--------------------------------------------------|-----------------------------------------------|
9| `edc.web.rest.cors.enabled` | Enables or disables the CORS filter | false |
10| `edc.web.rest.cors.origins` | Defines allowed origins for the CORS filter | "*" |
11| `edc.web.rest.cors.headers` | Defines allowed headers for the CORS filter | "origin, content-type, accept, authorization" |
12| `edc.web.rest.cors.methods` | Defines allowed methods for the CORS filter | "GET, POST, DELETE, PUT, OPTIONS" |
13
14## Exception handling
15
16The `JerseyService` provide 3 exception mappers:
17 - `EdcApiExceptionMapper`: catches all the `EdcApiException` exceptions, map them to a 4xx response code with a detailed response body
18 - `ValidationExceptionMapper`: catches all the `ConstraintViolationException` exceptions thrown by the `jersey-bean-validation` module, it maps them to a 400 response code with a detailed response body
19 - Exception mapper that catches all the exceptions that are not handled by the other mappers, for example:
20 - all the `java.lang` exceptions
21 - jakarta.ws.rs.WebApplicationException and subclasses