mirror of
				https://github.com/beego/bee.git
				synced 2025-10-26 18:53:51 +00:00 
			
		
		
		
	fix *time.Time type parse error.
This commit is contained in:
		| @@ -57,7 +57,7 @@ Prints the current Bee, Beego and Go version alongside the platform information. | |||||||
| } | } | ||||||
| var outputFormat string | var outputFormat string | ||||||
|  |  | ||||||
| const version = "1.9.1" | const version = "1.9.2" | ||||||
|  |  | ||||||
| func init() { | func init() { | ||||||
| 	fs := flag.NewFlagSet("version", flag.ContinueOnError) | 	fs := flag.NewFlagSet("version", flag.ContinueOnError) | ||||||
|   | |||||||
| @@ -77,7 +77,7 @@ var basicTypes = map[string]string{ | |||||||
| 	"byte":       "string:byte", | 	"byte":       "string:byte", | ||||||
| 	"rune":       "string:byte", | 	"rune":       "string:byte", | ||||||
| 	// builtin golang objects | 	// builtin golang objects | ||||||
| 	"time.Time": "string:string", | 	"time.Time": "string:datetime", | ||||||
| } | } | ||||||
|  |  | ||||||
| var stdlibObject = map[string]string{ | var stdlibObject = map[string]string{ | ||||||
| @@ -919,7 +919,7 @@ func parseObject(d *ast.Object, k string, m *swagger.Schema, realTypes *[]string | |||||||
| 			mp := swagger.Propertie{} | 			mp := swagger.Propertie{} | ||||||
| 			if isSlice { | 			if isSlice { | ||||||
| 				mp.Type = "array" | 				mp.Type = "array" | ||||||
| 				if isBasicType(strings.Replace(realType, "[]", "", -1)) { | 				if sType, ok := basicTypes[(strings.Replace(realType, "[]", "", -1))]; ok { | ||||||
| 					typeFormat := strings.Split(sType, ":") | 					typeFormat := strings.Split(sType, ":") | ||||||
| 					mp.Items = &swagger.Propertie{ | 					mp.Items = &swagger.Propertie{ | ||||||
| 						Type:   typeFormat[0], | 						Type:   typeFormat[0], | ||||||
| @@ -1035,6 +1035,9 @@ func typeAnalyser(f *ast.Field) (isSlice bool, realType, swaggerType string) { | |||||||
| 	switch t := f.Type.(type) { | 	switch t := f.Type.(type) { | ||||||
| 	case *ast.StarExpr: | 	case *ast.StarExpr: | ||||||
| 		basicType := fmt.Sprint(t.X) | 		basicType := fmt.Sprint(t.X) | ||||||
|  | 		if object, isStdLibObject := stdlibObject[basicType]; isStdLibObject { | ||||||
|  | 			basicType = object | ||||||
|  | 		} | ||||||
| 		if k, ok := basicTypes[basicType]; ok { | 		if k, ok := basicTypes[basicType]; ok { | ||||||
| 			return false, basicType, k | 			return false, basicType, k | ||||||
| 		} | 		} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 guoshaowei
					guoshaowei