name
Specifies the YAML/JSON key name for this field if it differs from the property name.
This is useful when the configuration file uses a different naming convention than your Kotlin code (e.g., snake_case vs camelCase).
Example:
// Maps "server_port" in config file to "serverPort" property
field(AppConfig::serverPort).name("server_port")Content copied to clipboard
Return
this FieldConfigScope for method chaining
Parameters
yaml Name
the key name to use in the configuration file