Add support for omitting content fields from JSON responses
With a new system/item
package interface, item.Omittable
, Ponzu content API responses can now be told to keep arbitrary struct fields from being exposed. The Omit
method implements this interface by returning a []string
containing the names of the JSON struct tags for the type whose fields you want omitted.
type Omittable interface {
Omit() []string
}
As usual, upgrade by:
$ go get -u github.com/ponzu-cms/ponzu/...
$ cd $PROJ && ponzu upgrade