Skip to content

Commit 5818880

Browse files
authored
update: Cancel the scientific notation of numbers (#228)
1 parent b0e3baf commit 5818880

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### Master
44

5+
- update: Cancel the scientific notation of numbers
56
- fix: Invoke error when reading parameter value from file using `-FILE`
67

78
### 3.0.28

openapi/output_filter.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ func NewTableOutputFilter(ctx *cli.Context) OutputFilter {
6969
func (a *TableOutputFilter) FilterOutput(s string) (string, error) {
7070
var v interface{}
7171
s = fmt.Sprintf("{\"RootFilter\":[%s]}", s)
72-
err := json.Unmarshal([]byte(s), &v)
72+
decoder := json.NewDecoder(bytes.NewBufferString(s))
73+
decoder.UseNumber()
74+
err := decoder.Decode(&v)
7375
if err != nil {
7476
return s, fmt.Errorf("unmarshal output failed %s", err)
7577
}

0 commit comments

Comments
 (0)