code: func (t *HighlightDsl) MarshalJSON() ([]byte, error) {
  	m := make(map[string]interface{})
  
  	if t.Fields != nil {
  		m["fields"] = t.Fields
  	}
  
  	if t.TagSchema != "" {
  		m["tag_schema"] = t.TagSchema
  	}
  
  	if t.Settings == nil {
  		return json.Marshal(m)
  	}
  
  	//This is terrible :(, could use structs package to avoid extra serialization.
  	embed, err := json.Marshal(t.Settings)
  	if err == nil {
  		err = json.Unmarshal(embed, &m)
  	}
  
  	if err == nil {
  		return json.Marshal(m)
  	}
  
  	return nil, err
  }
docs: // Custom marshalling