code: func (p *postIndexRequest) UnmarshalJSON(b []byte) error {
  
  	// m is an overflow map used to capture additional, unexpected keys.
  	m := make(map[string]interface{})
  	if err := json.Unmarshal(b, &m); err != nil {
  		return errors.Wrap(err, "unmarshalling unexpected values")
  	}
  
  	validIndexOptions := getValidOptions(pilosa.IndexOptions{})
  	err := validateOptions(m, validIndexOptions)
  	if err != nil {
  		return err
  	}
  	// Unmarshal expected values.
  	_p := _postIndexRequest{
  		Options: pilosa.IndexOptions{
  			Keys:           false,
  			TrackExistence: true,
  		},
  	}
  	if err := json.Unmarshal(b, &_p); err != nil {
  		return errors.Wrap(err, "unmarshalling expected values")
  	}
  
  	p.Options = _p.Options
  
  	return nil
  }
docs: // Custom Unmarshal JSON to validate request body when creating a new index.