Documentation
¶
Overview ¶
This tool modifies the types in our API design files to add JSON struct tags. We're doing this programmatically because there are many fields to modify and naming them and keeping them in sync with the required fields is error-prone.
This main file takes a list of file paths to modify. It will then add g.Meta("struct:tag:json", "<field name and optional omitempty>") calls to every g.Attribute and g.ErrorName call that's part of a g.Type or g.ResultType. If the field is not listed in the type's g.Required, the struct tag will have omitempty.
Click to show internal directories.
Click to hide internal directories.