forked from loafle/openapi-generator-original
[kotlin]Fix ktor doesn't generate nullable types (#5258)
* If not required, need `? = null` * run ./bin/kotlin-server-petstore.sh * Added `?` when value is `required` and `isNullable` * Rerun ./bin/kotlin-server-petstore.sh. But No differences
This commit is contained in:
parent
f6f5c9b8b9
commit
015b404729
@ -18,7 +18,7 @@ object Paths {
|
||||
{{#allParams}}* @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
||||
{{/allParams}}*/
|
||||
@KtorExperimentalLocationsAPI
|
||||
@Location("{{path}}") class {{operationId}}({{#allParams}}val {{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||
@Location("{{path}}") class {{operationId}}({{#allParams}}val {{paramName}}: {{{dataType}}}{{^required}}? = null{{/required}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||
|
||||
{{/bodyAllowed}}
|
||||
{{/operation}}
|
||||
|
@ -22,7 +22,7 @@ object Paths {
|
||||
* @param apiKey (optional)
|
||||
*/
|
||||
@KtorExperimentalLocationsAPI
|
||||
@Location("/pet/{petId}") class deletePet(val petId: kotlin.Long, val apiKey: kotlin.String)
|
||||
@Location("/pet/{petId}") class deletePet(val petId: kotlin.Long, val apiKey: kotlin.String? = null)
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
|
Loading…
x
Reference in New Issue
Block a user