MCPcopy
hub / github.com/swaggo/swag / TransToValidSchemeTypeWithFormat

Function TransToValidSchemeTypeWithFormat

schema.go:101–117  ·  view source on GitHub ↗

TransToValidSchemeTypeWithFormat indicates type will transfer golang basic type to swagger supported type with format.

(typeName string)

Source from the content-addressed store, hash-verified

99
100// TransToValidSchemeTypeWithFormat indicates type will transfer golang basic type to swagger supported type with format.
101func TransToValidSchemeTypeWithFormat(typeName string) (string, string) {
102 switch typeName {
103 case "int", "uint":
104 return INTEGER, ""
105 case "uint8", "int8", "uint16", "int16", "byte", "int32", "uint32", "rune":
106 return INTEGER, "int32"
107 case "uint64", "int64":
108 return INTEGER, "int64"
109 case "float32", "float64":
110 return NUMBER, typeName
111 case "bool":
112 return BOOLEAN, ""
113 case "string":
114 return STRING, ""
115 }
116 return typeName, ""
117}
118
119// TransToValidSchemeType indicates type will transfer golang basic type to swagger supported type.
120func TransToValidSchemeType(typeName string) string {

Callers 1

ParseParamCommentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…