helidon
helidon copied to clipboard
Mappable values
Resolves #1897 (mappable query params and path params) Related to #1789 (align mappers)
Added Value
and ValueProvider
to mapper
module.
It is now used in various HTTP classes (Headers, query parameters etc.) and in Config (ConfigValue
).
Added support for a shared MapperManager
that can be custom registered by user.
Mapping to basic types is built-in (String -> a lot of types), including date types. Format can be overridden through context if desired (see MapperManager.FORMAT_CLASSIFIER
).
The changes are fully backward compatible - we have to decide how to approach this (e.g. do we want to keep all the methods, or do we want to change signatures in the future?).
Created as a draft until we agree on approach.
It would be easier to have a markdown document going over the proposal. We should describe all the various use-cases with snippets:
- config
- dbclient
- media support
- webserver query params
Highlight the complex type usages with GenericType, document the special layering of media-support.
We should also have an example that demonstrates the value of this API when combining dbclient and webserver/webclient. E.g. Show how to support a custom entity all the way from a request payload to the database.
I am adding a docs-internal/generic-mapping-2.md