Skip to content

Commit 8c7504f

Browse files
committed
fix: fix failing to handle requests with emtpy non-required parameters
1 parent 56d687d commit 8c7504f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/resources/go-middleware-server/openapi/cast.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ import (
1212

1313
// cast converts from string of `from` to type `to`
1414
func cast(from string, to interface{}) error {
15+
// 空文字なら to に何も代入しない (= ゼロ値) とする
16+
if from == "" {
17+
return nil
18+
}
19+
1520
switch v := to.(type) {
1621
case (*int32):
1722
v64, err := strconv.ParseInt(from, 10, 64)

0 commit comments

Comments
 (0)