Skip to content

Commit

Permalink
Fix optional query parameter handling and turn into expected type
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisameling committed Jun 14, 2024
1 parent dadcc79 commit 3a952a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#isQueryParam}}{{#isArray}}ctx.queryParams("{{baseName}}"){{/isArray}}{{^isArray}}ctx.queryParamAsClass<String>("{{baseName}}").get(){{/isArray}}{{/isQueryParam}}
{{#isQueryParam}}{{#isArray}}ctx.queryParams("{{baseName}}"){{/isArray}}{{^isArray}}ctx.queryParamAsClass<{{{dataType}}}>("{{baseName}}"){{^required}}.allowNullable(){{/required}}.get(){{/isArray}}{{/isQueryParam}}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class UserApi(private val service: UserApiService) {
* @param password The password for login in clear text
*/
fun loginUser(ctx: Context) {
val result = service.loginUser(ctx.queryParamAsClass<String>("username").get(), ctx.queryParamAsClass<String>("password").get(), ctx)
val result = service.loginUser(ctx.queryParamAsClass<kotlin.String>("username").get(), ctx.queryParamAsClass<kotlin.String>("password").get(), ctx)
ctx.status(200).json(result)
}

Expand Down

0 comments on commit 3a952a3

Please sign in to comment.