Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions net/goai/goai.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,26 @@ func (oai *OpenApiV3) golangTypeToOAIType(t reflect.Type) string {
for t.Kind() == reflect.Pointer {
t = t.Elem()
}

switch t.String() {
case `time.Time`, `gtime.Time`:
return TypeString
case `ghttp.UploadFile`:
return TypeFile
case `[]uint8`:
return TypeString
case `uuid.UUID`:
return TypeString
}

switch t.Kind() {
case reflect.String:
return TypeString

case reflect.Struct:
switch t.String() {
case `time.Time`, `gtime.Time`:
return TypeString
case `ghttp.UploadFile`:
return TypeFile
}
return TypeObject

case reflect.Slice, reflect.Array:
switch t.String() {
case `[]uint8`:
return TypeString
}
return TypeArray

case reflect.Bool:
Expand Down
Loading