[Kotlin] support array, list in collection type#1564
[Kotlin] support array, list in collection type#1564wing328 merged 4 commits intoOpenAPITools:masterfrom absimas:kotlin-collection-type
array, list in collection type#1564Conversation
jimschubert
left a comment
There was a problem hiding this comment.
Looks good to me, although we may want to keep list as the default until the next major release as this will be a breaking change for regenerated clients.
I think I originally created the default as Array and someone had a compelling argument to default to List. Adding a configurable choice is the best way to solve the preference difference.
|
I don't quite understand your comment on the default. Current default is array and this code doesn't change that, thus this is not a breaking change. |
|
Oh unless you meant the default for |
|
@absimas yes, sorry for the confusion. For a non-breaking change we would want array and list to remain the same default type until the next major release. I haven't tested if this PR still works with type mappings (another way users can modify these defaults), so I (or someone else) need to test that before merge. |
|
Tested with both |
array, list in collection type
|
@absimas thanks for the PR, which has been included in the v3.3.4 release: https://twitter.com/oas_generator/status/1068772409795207168 |
* Allow specifying type * Add test * Update docs * Don't modify types if the default option is chosen
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\.master,3.4.x,4.0.x. Default:master.Description of the PR
Swagger spec file contains only array types thus it is always the preferred choice when converting to kotlin. Allow specifying which collection type to convert to.
@jimschubert @dr4ke616