diff --git a/service/README.md b/service/README.md index 5e40cc48dc369e954ea497f778a887b317ddf2ec..ce8c48cd7ee32ccf67df1508fc992c7af2efa312 100644 --- a/service/README.md +++ b/service/README.md @@ -97,7 +97,7 @@ Struct types used for input params/body must be structs with public fields and j Name string `json:"name"` } -The struct type is never marshaled to JSON by the framework, so omitempty has no effect. +The struct type is not marshaled to JSON by the framework, but is marshalled to a map that represents query params. The json omitempty decorator is then used to marshal or omit when not defined, and that may control behavior. One must include omitempty when absence/presence of an attribute is significant. Pointers may be used for optional items, or you may treat a zero value to indicate absence.