code: func AttributeImports(att *design.AttributeDefinition, imports []*ImportSpec, seen []*design.AttributeDefinition) []*ImportSpec {
  
  	for _, a := range seen {
  		if att == a {
  			return imports
  		}
  	}
  	seen = append(seen, att)
  
  	if tname, ok := att.Metadata["struct:field:type"]; ok {
  		if len(tname) > 1 {
  			tagImp := SimpleImport(tname[1])
  			impSlice := []*ImportSpec{tagImp}
  			imports = appendImports(imports, impSlice)
  		}
  	}
  
  	switch t := att.Type.(type) {
  	case *design.UserTypeDefinition:
  		return appendImports(imports, AttributeImports(t.AttributeDefinition, imports, seen))
  	case *design.MediaTypeDefinition:
  		return appendImports(imports, AttributeImports(t.AttributeDefinition, imports, seen))
  	case design.Object:
  		t.IterateAttributes(func(n string, t *design.AttributeDefinition) error {
  			imports = appendImports(imports, AttributeImports(t, imports, seen))
  			return nil
  		})
  		return imports
  	case *design.Array:
  		return appendImports(imports, AttributeImports(t.ElemType, imports, seen))
  	case *design.Hash:
  		imports = appendImports(imports, AttributeImports(t.KeyType, imports, seen))
  		return appendImports(imports, AttributeImports(t.ElemType, imports, seen))
  	}
  
  	return imports
  }
docs: // AttributeImports will construct a new ImportsSpec slice from an existing slice and add in imports specified in
  // struct:field:type Metadata tags.