Closed BillCarsonFr closed 3 months ago
When using white spaces in oneOf enum types the generated kotlin and swift code was not valid (white space in the property name).
oneOf
The main changes are in kotlin.py and swift.py, typescript generation was ok with whitespaces.
kotlin.py
swift.py
The change will be invisible for users of the library.
For kotlin, a new field rawValue is added in the generated enum and is used in the getProperties method instead of the enum autogenerated name.
rawValue
getProperties
Before:
enum class VerificationState { NotVerified, ... override fun getProperties(): Map<String, Any>? { ... put("verificationState", verificationState.name) ... }
After
enum class VerificationState(val rawValue: String) { NotVerified("NotVerified"), ... override fun getProperties(): Map<String, Any>? { ... put("verificationState", verificationState.rawValue) ... }
The enum were alreasy : String just now explicitely adding the rawvalue
: String
public enum VerificationState: String { ... case NotVerified
Now:
public enum VerificationState: String { ... case NotVerified = "NotVerified"
When using white spaces in
oneOf
enum types the generated kotlin and swift code was not valid (white space in the property name).The main changes are in
kotlin.py
andswift.py
, typescript generation was ok with whitespaces.The change will be invisible for users of the library.
Kotlin
For kotlin, a new field
rawValue
is added in the generated enum and is used in thegetProperties
method instead of the enum autogenerated name.Before:
After
Swift
The enum were alreasy
: String
just now explicitely adding the rawvalueBefore:
Now: