code: func (tsp *TorrentSetPayload) MarshalJSON() (data []byte, err error) {
  	// Build an intermediary payload with base types
  	type baseTorrentSetPayload TorrentSetPayload
  	tmp := struct {
  		SeedIdleLimit *int64 `json:"seedIdleLimit"`
  		*baseTorrentSetPayload
  	}{
  		baseTorrentSetPayload: (*baseTorrentSetPayload)(tsp),
  	}
  	if tsp.SeedIdleLimit != nil {
  		sil := int64(*tsp.SeedIdleLimit / time.Minute)
  		tmp.SeedIdleLimit = &sil
  	}
  	// Build a payload with only the non nil fields
  	tspv := reflect.ValueOf(tmp)
  	tspt := tspv.Type()
  	cleanPayload := make(map[string]interface{}, tspt.NumField())
  	var currentValue, nestedStruct, currentNestedValue reflect.Value
  	var currentStructField, currentNestedStructField reflect.StructField
  	var j int
  	for i := 0; i < tspv.NumField(); i++ {
  		currentValue = tspv.Field(i)
  		currentStructField = tspt.Field(i)
  		if !currentValue.IsNil() {
  			if currentStructField.Name == "baseTorrentSetPayload" {
  				// inherited/nested struct
  				nestedStruct = reflect.Indirect(currentValue)
  				for j = 0; j < nestedStruct.NumField(); j++ {
  					currentNestedValue = nestedStruct.Field(j)
  					currentNestedStructField = nestedStruct.Type().Field(j)
  					if !currentNestedValue.IsNil() {
  						cleanPayload[currentNestedStructField.Tag.Get("json")] = currentNestedValue.Interface()
  					}
  				}
  			} else {
  				// Overloaded field
  				cleanPayload[currentStructField.Tag.Get("json")] = currentValue.Interface()
  			}
  		}
  	}
  	// Marshall the clean payload
  	return json.Marshal(cleanPayload)
  }
docs: // MarshalJSON allows to marshall into JSON only the non nil fields.
  // It differs from 'omitempty' which also skip default values
  // (as 0 or false which can be valid here).