Closed debug-ito closed 1 year ago
On the documentation of Generic instances: sadly it's not documented on the site right now, at least not directly, it's mostly on that page that you mention. You can look at the tests which I think are fairly easy to read but I agree that we should have that documented in the site.
The logic for the field to key transformation is stripping the name of the constructor from the field. so if the field is named MyRecordSomethig
and the field is myRecordSomethigField
will result in the key field
.
NOTES:
On the server.port
thing, yes! that's a typo, it should be warp.port
. Thanks a lot for pointing that out!
Thanks for clarification!
Is there any specification or documents on how the
Generic
-based instance ofFromConfig
is implemented? Specifically, what is the mapping between the record field names andKey
s?For example, in the Multiple configs and generics tutorial,
FromConfig
instance forAppConfig
is given by the library based on theGeneric
.How does that
FromConfig
instance map the field names toKey
s? Does it automatically removeappConfig
prefix? If so, can I customize that mapping rule?In addition, the later part of the tutorial says that
server.port
key maps to the warp's listening port parameter. However, I cannot understand where theserver
prefix comes.