You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the above command on the declaration file provided
This will generate the following template:
/*** Optional Parameter Demo* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)** The version of the OpenAPI document: 0.0.1*** NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).* https://openapi-generator.tech* Do not edit the class manually.*/packageorg.openapitools.serverimportio.ktor.locations.KtorExperimentalLocationsAPIimportio.ktor.locations.Locationobject Paths {
/** * * * @param mandatory * @param optional (optional)*/
@KtorExperimentalLocationsAPI
@Location("/foo") classfooGet(valmandatory: kotlin.Int, valoptional: kotlin.Int)
}
Optional parameters are not annotated as nullable (?).
Suggest a fix/enhancement
Paths.kt.mustache should be ammended to print ? for optional parameters.
The text was updated successfully, but these errors were encountered:
Description
The kotlin-server/ Ktor generator generates a
Path.kt
file that doesn't mark optional parameters as nullable.openapi-generator version
openapi-generator-cli/4.2.3
OpenAPI declaration file content or url
Command line used for generation
java -jar openapi-generator-cli.jar generate -i demo.yaml -g kotlin-server -o test/
Steps to reproduce
This will generate the following template:
Optional parameters are not annotated as nullable (
?
).Suggest a fix/enhancement
Paths.kt.mustache should be ammended to print
?
for optional parameters.The text was updated successfully, but these errors were encountered: