Files
query-orchestration/vendor/github.com/swaggo/swag/generics_other.go
T
Jay Brown 174644b63c Merged in jb/openapi (pull request #22)
add openapi infra

* add openapi infra

Includes generated stubs and all deps

* generatetolocation

* basesetupoffunctionsandclient

* round1controllertests

* passintegrationtests

* cleanupfromfullsuite

* storedjson

* fixjsonyaml

* fixtests


Approved-by: Michael McGuinness
2025-01-15 19:45:51 +00:00

43 lines
1.0 KiB
Go

//go:build !go1.18
// +build !go1.18
package swag
import (
"fmt"
"github.com/go-openapi/spec"
"go/ast"
)
type genericTypeSpec struct {
ArrayDepth int
TypeSpec *TypeSpecDef
Name string
}
func (pkgDefs *PackagesDefinitions) parametrizeGenericType(file *ast.File, original *TypeSpecDef, fullGenericForm string) *TypeSpecDef {
return original
}
func getGenericFieldType(file *ast.File, field ast.Expr, genericParamTypeDefs map[string]*genericTypeSpec) (string, error) {
return "", fmt.Errorf("unknown field type %#v", field)
}
func (parser *Parser) parseGenericTypeExpr(file *ast.File, typeExpr ast.Expr) (*spec.Schema, error) {
switch typeExpr.(type) {
// suppress debug messages for these types
case *ast.InterfaceType:
case *ast.StructType:
case *ast.Ident:
case *ast.StarExpr:
case *ast.SelectorExpr:
case *ast.ArrayType:
case *ast.MapType:
case *ast.FuncType:
default:
parser.debug.Printf("Type definition of type '%T' is not supported yet. Using 'object' instead.\n", typeExpr)
}
return PrimitiveSchema(OBJECT), nil
}