gen/api15gen/param_analyzer.go
func (p *ParamAnalyzer) parseDataType(path string, child *gen.ActionParam) gen.DataType {
	param := p.rawParams[path].(map[string]interface{})
	class := "String"
	if c, ok := param["class"].(string); ok {
		class = c
	}
	var res gen.DataType
	switch class {
	case "Integer":
		i := gen.BasicDataType("int")
		res = &i
	case "String":
		s := gen.BasicDataType("string")
		res = &s
	case "Array":
		if child != nil {
			res = &gen.ArrayDataType{child}
		} else {
			s := gen.BasicDataType("string")
			p := p.newParam(fmt.Sprintf("%s[item]", path),
				map[string]interface{}{}, &s)
			res = &gen.ArrayDataType{p}
		}
	case "SourceUpload":
		res = new(gen.SourceUploadDataType)
	case "FileUpload", "Tempfile":
		res = &gen.UploadDataType{TypeName: "FileUpload"}
	case "Enumerable":
		res = new(gen.EnumerableDataType)
	case "Hash":
		if current, ok := p.parsed[path]; ok {
			res = current.Type
			o := res.(*gen.ObjectDataType)
			o.Fields = appendSorted(o.Fields, child)
		} else {
			oname := p.typeName(path)
			res = &gen.ObjectDataType{oname, []*gen.ActionParam{child}}
		}
	}
	return res
}
func (p *ParamAnalyzer) parseDataType(path string, child *gen.ActionParam) gen.DataType {
	param := p.rawParams[path].(map[string]interface{})
	class := "String"
	if c, ok := param["class"].(string); ok {
		class = c
	}
	var res gen.DataType
	switch class {
	case "Integer":
		i := gen.BasicDataType("int")
		res = &i
	case "String":
		s := gen.BasicDataType("string")
		res = &s
	case "Array":
		if child != nil {
			res = &gen.ArrayDataType{child}
		} else {
			s := gen.BasicDataType("string")
			p := p.newParam(fmt.Sprintf("%s[item]", path),
				map[string]interface{}{}, &s)
			res = &gen.ArrayDataType{p}
		}
	case "SourceUpload":
		res = new(gen.SourceUploadDataType)
	case "FileUpload", "Tempfile":
		res = &gen.UploadDataType{TypeName: "FileUpload"}
	case "Enumerable":
		res = new(gen.EnumerableDataType)
	case "Hash":
		if current, ok := p.parsed[path]; ok {
			res = current.Type
			o := res.(*gen.ObjectDataType)
			o.Fields = appendSorted(o.Fields, child)
		} else {
			oname := p.typeName(path)
			res = &gen.ObjectDataType{oname, []*gen.ActionParam{child}}
		}
	}
	return res
}
// Parse data type in context