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
Parses the JSON back as a map[string]any, resulting in the numbers being converted to float64 -- already not great her I think
Constructs the query parameter values using fmt.Sprintf("=%v, ...) resulting in the integer parameter using floating point "e" notation if it's greater than ~ 100000
The generated server then refuses to parse values like 1.23454678e9 as not valid string representations of integers
I think that, if it has to go through the unfortunate JSON loop, it should use a json.Decoder with UseNumber() applied so that numbers are retained at full fidelity. This is what styleStruct does for other styles:
Given a parameter like this:
The generated client code:
map[string]any
, resulting in the numbers being converted tofloat64
-- already not great her I thinkfmt.Sprintf("=%v, ...)
resulting in the integer parameter using floating point "e" notation if it's greater than ~ 1000001.23454678e9
as not valid string representations of integersItem 2 happens in
MarshalDeepObject
:runtime/deepobject.go
Line 75 in 35e8035
Item 3 happens just above in
marshalDeepObject
:runtime/deepobject.go
Line 58 in 35e8035
I think that, if it has to go through the unfortunate JSON loop, it should use a
json.Decoder
withUseNumber()
applied so that numbers are retained at full fidelity. This is whatstyleStruct
does for other styles:runtime/styleparam.go
Lines 235 to 236 in 35e8035
The text was updated successfully, but these errors were encountered: