Installation
The library is published to the conta-open Maven repository on GitLab.
Add the repository to your build:
repositories {
mavenCentral()
maven {
name = 'contaOpen'
url = 'https://gitlab.com/api/v4/groups/12992043/-/packages/maven'
}
}
For the latest released version, see the tags page.
Replace <version> in the snippets below with that value.
Compatibility
| conta-problem-json | Micronaut | Java |
|---|---|---|
1.x |
4 |
17 |
2.x |
5 |
25 |
Micronaut 4 services stay on 1.x.
On 2.x, validating a Violation rejects a blank field or message; 1.x never enforced that constraint.
Server-side (controllers)
For Micronaut services that throw problems, depend on conta-problem-json-mn:
dependencies {
implementation 'no.conta.problem:conta-problem-json-mn:<version>'
}
This module brings the API along transitively and registers the Micronaut error handlers that translate ThrowableProblem (and Bean Validation errors) into application/problem+json responses.
Client-side (forwarding)
For Micronaut services that consume upstream services and want to forward their problem responses, depend on conta-problem-json-mn-client:
dependencies {
implementation 'no.conta.problem:conta-problem-json-mn-client:<version>'
}
See Forwarding Upstream Problems for usage.