Closed
Description
Current issue
Now, defining a naming strategy impacts both records' and fields' name... Well it seems. It only applies the naming strategy to field names (and the fixed names as it relies on the field name).
Proposal
Have a clear FieldNamingStrategy
and improve the interface:
public interface FieldNamingStrategy {
public fun resolve(
descriptor: SerialDescriptor,
elementIndex: Int,
): String
public companion object Builtins {
public object NoOp : FieldNamingStrategy {
override fun resolve(
descriptor: SerialDescriptor,
elementIndex: Int,
): String = descriptor.getElementName(elementIndex)
}
public object SnakeCase : FieldNamingStrategy {
// ...
}
public object PascalCase : {
// ...
}
}
}