mirror of
				https://github.com/beego/bee.git
				synced 2025-11-03 23:03:27 +00:00 
			
		
		
		
	Merge 06eb48f6b9 into ebb8c0ad31
				
					
				
			This commit is contained in:
		@@ -37,9 +37,10 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	bu "github.com/beego/bee/v2/utils"
 | 
						bu "github.com/beego/bee/v2/utils"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	beeLogger "github.com/beego/bee/v2/logger"
 | 
					 | 
				
			||||||
	"github.com/beego/beego/v2/core/utils"
 | 
						"github.com/beego/beego/v2/core/utils"
 | 
				
			||||||
	"github.com/beego/beego/v2/server/web/swagger"
 | 
						"github.com/beego/beego/v2/server/web/swagger"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						beeLogger "github.com/beego/bee/v2/logger"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
@@ -1092,6 +1093,17 @@ func parseStruct(imports []*ast.ImportSpec, st *ast.StructType, k string, m *swa
 | 
				
			|||||||
	if st.Fields.List != nil {
 | 
						if st.Fields.List != nil {
 | 
				
			||||||
		m.Properties = make(map[string]swagger.Propertie)
 | 
							m.Properties = make(map[string]swagger.Propertie)
 | 
				
			||||||
		for _, field := range st.Fields.List {
 | 
							for _, field := range st.Fields.List {
 | 
				
			||||||
 | 
								// skip processing if field is not exported
 | 
				
			||||||
 | 
								var exported = field.Names == nil
 | 
				
			||||||
 | 
								for _, ident := range field.Names {
 | 
				
			||||||
 | 
									if ident.IsExported() {
 | 
				
			||||||
 | 
										exported = true
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if !exported {
 | 
				
			||||||
 | 
									continue
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			isSlice, realType, sType := typeAnalyser(field)
 | 
								isSlice, realType, sType := typeAnalyser(field)
 | 
				
			||||||
			if (isSlice && isBasicType(realType)) || sType == astTypeObject {
 | 
								if (isSlice && isBasicType(realType)) || sType == astTypeObject {
 | 
				
			||||||
				if len(strings.Split(realType, " ")) > 1 {
 | 
									if len(strings.Split(realType, " ")) > 1 {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user