https://kotlinlang.org logo
#hoplite
Title
# hoplite
d

dave08

09/28/2023, 3:57 PM
Say I have:
Copy code
http-clients:
  client-1:
    url: ...
and I'd like to map it to:
Copy code
data class Configs(val httpClients: List<HttpClientConfig>)

data class HttpClientConfig(val name: String, val url: String) // Is there some kind of annotation to pull the name 'client-1' out from the map key and use it as name here and have the result as a list? Or even:

data class Configs(val httpClients: Map<String, HttpClientConfig>) // And still not having to specify name in client-1 configs since it can be pulled in from the key...?
3 Views