Skip to content

[Kotlin SpringBoot Server] fix optional parameter not correctly declared in service#2538

Closed
karismann wants to merge 1 commit intoOpenAPITools:masterfrom
karismann:Kotlin-SpringBoot-Server-fix-optional-parameter
Closed

[Kotlin SpringBoot Server] fix optional parameter not correctly declared in service#2538
karismann wants to merge 1 commit intoOpenAPITools:masterfrom
karismann:Kotlin-SpringBoot-Server-fix-optional-parameter

Conversation

@karismann
Copy link
Contributor

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{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\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
    @jimschubert (2017/09), @dr4ke616 (2018/08)

Description of the PR

fix optional parameter not correctly declared in service (bug released after #1107)
add Kotlin SpringBoot Server in ensure up to date script

{{#operation}}

fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{#hasMore}},{{/hasMore}}{{/allParams}}): {{>returnTypes}}
fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}},{{/hasMore}}{{/allParams}}): {{>returnTypes}}
Copy link
Member

@macjohnny macjohnny Mar 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be better to use {{>optionalDataType}}, i.e.

Suggested change
fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}},{{/hasMore}}{{/allParams}}): {{>returnTypes}}
fun {{operationId}}({{#allParams}}{{paramName}}: {{>optionalDataType}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): {{>returnTypes}}

{{#operation}}

override fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{#hasMore}},{{/hasMore}}{{/allParams}}): {{>returnTypes}} {
override fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}},{{/hasMore}}{{/allParams}}): {{>returnTypes}} {
Copy link
Member

@macjohnny macjohnny Mar 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
override fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}},{{/hasMore}}{{/allParams}}): {{>returnTypes}} {
override fun {{operationId}}({{#allParams}}{{paramName}}: {{>optionalDataType}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): {{>returnTypes}} {

@karismann karismann closed this Mar 28, 2019
@karismann karismann deleted the Kotlin-SpringBoot-Server-fix-optional-parameter branch March 28, 2019 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments