Open herveDarritchon opened 5 years ago
I'd go with Array to limit the responsibility of the wire protocol generator defaults, and move the debate to command-line options for List, Sequence, etc.
ok, that sounds fair. Do you think we can go this way ?
@herveDarritchon https://github.com/jnorthrup/XChange/blob/3aa6eacb335925248e1a78a4f6dac35b7976190d/xchange-idex/pom.xml#L71
does this help minimize the impact you are experiencing?
in kotlin, List and MutableList are not identical, and sometimes the null-free nanny stuff will put a hard compilation error in places during migration.
also, with an Array, though potentially mutable, you have slightly better thread safety assumptions, where it takes a lot more effort to get a concurrency violation. my $.02 -- the cmdline switch or maven config is hopefully well positioned to mitigate the constraints on your models
Android Studio even warns when using kotlin.Array in data classes:
When using kotlin.List the warning goes away.
<typeMappings><typeMapping>array=kotlin.List</typeMapping></typeMappings>
is the solution for android studio users to be sure.
This issue aim is to open a dialog with you. I'd like to propose an evolution in the Kotlin template.
Currently, all the array in the Swagger Spec are transformed to kotlin.Array.
I propose to change that, so to transform array to List collections instead. I think, as in Java, it's better to handle List than Array.
What do you think about that ? Do you think it's a bad idea. Before proposing the pull request, I prefer asking the community.
Thanks