openapidoc

package
v0.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const DefaultSecurityDefinitionName = "Bearer"

Variables

This section is empty.

Functions

func Format

func Format(t reflect.Type) string

func GetContentType added in v0.16.0

func GetContentType[T any]() (string, bool)

func Param

func Param(t reflect.Type, name, in string) (*spec.Parameter, error)

func RegisterContentType added in v0.16.0

func RegisterContentType[T any](contentType string)

func RegisterFormat

func RegisterFormat[T any](format string)

func RegisterResponse added in v0.16.0

func RegisterResponse[T any](response *spec.Response)

func RegisterSchema added in v0.16.0

func RegisterSchema[T any](schema *spec.Schema)

func Response added in v0.16.0

func Response(t reflect.Type) (*spec.Response, error)

func Schema

func Schema(t reflect.Type, requireTag bool) (*spec.Schema, error)

func SwaggerUI

func SwaggerUI() http.Handler

func Type

func Type(t reflect.Type) string

Types

type APIDocer

type APIDocer interface {
	APIDoc(context.Context) (*spec.Swagger, error)
}

type OperationMiddleware

type OperationMiddleware interface {
	OperationMiddleware(*spec.Operation) *spec.Operation
}

type Operationer

type Operationer interface {
	Operation(ctx context.Context) (*spec.Operation, error)
}

type Pathser

type Pathser interface {
	Paths(ctx context.Context, basePath string) (*spec.Paths, error)
}

type SwaggerOption

type SwaggerOption func(*spec.Swagger) *spec.Swagger

func AddDefaultSecurityDefinition added in v0.16.0

func AddDefaultSecurityDefinition() SwaggerOption

func AddSecurityDefinition added in v0.16.0

func AddSecurityDefinition(name string, securityScheme *spec.SecuritySchemeProps) SwaggerOption

func BasePath

func BasePath(basePath string) SwaggerOption

func Info

func Info(info spec.InfoProps) SwaggerOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL