-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Kotlin] support array
, list
in collection type
#1564
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.sh
and./bin/security/{LANG}-petstore.sh
if 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