code: func (d *dupper) DupType(t DataType) DataType {
  	switch actual := t.(type) {
  	case Primitive:
  		return t
  	case *Array:
  		return &Array{ElemType: d.DupAttribute(actual.ElemType)}
  	case Object:
  		res := make(Object, len(actual))
  		for n, att := range actual {
  			res[n] = d.DupAttribute(att)
  		}
  		return res
  	case *Hash:
  		return &Hash{
  			KeyType:  d.DupAttribute(actual.KeyType),
  			ElemType: d.DupAttribute(actual.ElemType),
  		}
  	case *UserTypeDefinition:
  		if u, ok := d.dts[actual.TypeName]; ok {
  			return u
  		}
  		u := &UserTypeDefinition{
  			TypeName: actual.TypeName,
  		}
  		d.dts[u.TypeName] = u
  		u.AttributeDefinition = d.DupAttribute(actual.AttributeDefinition)
  		return u
  	case *MediaTypeDefinition:
  		if m, ok := d.dmts[actual.Identifier]; ok {
  			return m
  		}
  		m := &MediaTypeDefinition{
  			Identifier: actual.Identifier,
  			Links:      actual.Links,
  			Views:      actual.Views,
  			Resource:   actual.Resource,
  		}
  		d.dmts[actual.Identifier] = m
  		m.UserTypeDefinition = d.DupUserType(actual.UserTypeDefinition)
  		return m
  	}
  	panic("unknown type " + t.Name())
  }
docs: // DupType creates a copy of the given data type.