elementNames

Returns an iterable of all descriptor element names.

Example:

@Serializable
class User(val name: String, val alias: String?)

User.serializer().descriptor.elementNames.toList() // Returns ["name", "alias"]