Skip to content

Add support for omitting content fields from JSON responses

Compare
Choose a tag to compare
@nilslice nilslice released this 13 Feb 19:21
· 377 commits to master since this release

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