TransToValidSchemeTypeWithFormat indicates type will transfer golang basic type to swagger supported type with format.
(typeName string)
| 99 | |
| 100 | // TransToValidSchemeTypeWithFormat indicates type will transfer golang basic type to swagger supported type with format. |
| 101 | func 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. |
| 120 | func TransToValidSchemeType(typeName string) string { |
no outgoing calls
no test coverage detected
searching dependent graphs…