We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7222df8 commit a0db4d0Copy full SHA for a0db4d0
lib.go
@@ -5,6 +5,7 @@ import (
5
"log/slog"
6
"os"
7
"regexp"
8
+ "strconv"
9
10
"github.com/pb33f/libopenapi"
11
v3 "github.com/pb33f/libopenapi/datamodel/high/v3"
@@ -179,13 +180,13 @@ func interpolatePath(cmd *cobra.Command, h *HandlerData) error {
179
180
value, _ = flags.GetString(param.Name)
181
case Integer:
182
v, _ := flags.GetInt(param.Name)
- value = fmt.Sprintf("%d", v)
183
+ value = strconv.FormatInt(int64(v), 10)
184
case Number:
185
v, _ := flags.GetFloat64(param.Name)
- value = fmt.Sprintf("%g", v)
186
+ value = strconv.FormatFloat(v, 'g', -1, 64)
187
case Boolean:
188
v, _ := flags.GetBool(param.Name)
- value = fmt.Sprintf("%t", v)
189
+ value = strconv.FormatBool(v)
190
}
191
192
h.Path = pattern.ReplaceAllString(h.Path, value)
0 commit comments