code: func (u *Shape) UnmarshalJSON(b []byte) error {
  	var tmp interface{}
  	if err := json.Unmarshal(b, &tmp); err != nil {
  		return err
  	}
  	switch v := tmp.(type) {
  	case map[string]interface{}:
  		if makeShapeVariantPolyline(b, u, v) {
  			return nil
  		}
  		if makeShapeVariantRect(b, u, v) {
  			return nil
  		}
  	}
  	return fmt.Errorf("Cannot unmarshal JSON to union type Shape")
  }
docs: //
  // UnmarshalJSON for Shape
  //