Conta HTTP
conta-http is Conta’s shared, open-source library for HTTP / API conventions on both sides of the call.
It standardizes how our APIs bind paginated requests and how they shape responses. It is the home of Conta’s standardized API response envelope.
The two pillars
- Request binding
-
The
@RequestBean-enabledPagingparams class converts page/size/order query parameters into a MicronautPageable. TheQueryParamGuardrejects any query parameter that no endpoint binding declares. - Response shaping
-
The
Envelope<T>interface is the standardized response envelope; the concrete shapes areSingleEnvelopeandSliceEnvelope.Envelopes.slice(…)turns a MicronautPageorSliceinto aSliceEnvelope. On the client side,@UnwrapEnvelopelets a declarative@Clientdeclare the inner payload type and have the envelope’scontentlifted transparently.
Modules
conta-http-kit carries the server-side pillars (request binding and response shaping); conta-http-client-kit carries the client-side conventions; conta-http-mock-server is a test-support module for testing HTTP clients.
| Module | Package | Contents |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mock HTTP server for testing clients — |
Getting started
See Getting started for the dependency coordinate and Micronaut wiring.