174644b63c
add openapi infra * add openapi infra Includes generated stubs and all deps * generatetolocation * basesetupoffunctionsandclient * round1controllertests * passintegrationtests * cleanupfromfullsuite * storedjson * fixjsonyaml * fixtests Approved-by: Michael McGuinness
43 lines
1.0 KiB
Go
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
|
|
}
|