MCPcopy
hub / github.com/gin-gonic/gin / decodeJSON

Function decodeJSON

binding/json.go:44–56  ·  view source on GitHub ↗
(r io.Reader, obj any)

Source from the content-addressed store, hash-verified

42}
43
44func decodeJSON(r io.Reader, obj any) error {
45 decoder := json.API.NewDecoder(r)
46 if EnableDecoderUseNumber {
47 decoder.UseNumber()
48 }
49 if EnableDecoderDisallowUnknownFields {
50 decoder.DisallowUnknownFields()
51 }
52 if err := decoder.Decode(obj); err != nil {
53 return err
54 }
55 return validate(obj)
56}

Callers 2

BindMethod · 0.85
BindBodyMethod · 0.85

Calls 5

UseNumberMethod · 0.95
DisallowUnknownFieldsMethod · 0.95
DecodeMethod · 0.95
validateFunction · 0.70
NewDecoderMethod · 0.65

Tested by

no test coverage detected