code: func (a *PipelineAggregation) MarshalJSON() ([]byte, error) {
  	root := map[string]interface{}{
  		"buckets_path": a.BucketPath,
  	}
  
  	for k, v := range a.Settings {
  		if k != "" && v != nil {
  			root[k] = v
  		}
  	}
  
  	return json.Marshal(root)
  }
docs: // MarshalJSON returns the JSON encoding of the pipeline aggregation