Documentation
¶
Index ¶
- func BootstrapV3(rootCmd *cobra.Command, model libopenapi.DocumentModel[v3.Document], ...) errordeprecated
- func BootstrapV3Cobra(rootCmd *cobra.Command, model libopenapi.DocumentModel[v3.Document], ...) error
- func BootstrapV3UrfaveCliV3(rootCmd *cli.Command, model libopenapi.DocumentModel[v3.Document], ...) error
- func LoadFileV3(path string) (*libopenapi.DocumentModel[v3.Document], error)
- func LoadV3(data []byte) (*libopenapi.DocumentModel[v3.Document], error)
- type Handlerdeprecated
- type HandlerCobra
- type HandlerData
- type HandlerUrfaveCliV3
- type OpenAPIType
- type ParamMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BootstrapV3
deprecated
func BootstrapV3(rootCmd *cobra.Command, model libopenapi.DocumentModel[v3.Document], handlers map[string]Handler) error
Bootstraps a cobra.Command with the loaded model and a handler map
Deprecated: Will be kept for backwards compatibility. Use BootstrapV3Cobra instead.
func BootstrapV3Cobra ¶
func BootstrapV3Cobra(rootCmd *cobra.Command, model libopenapi.DocumentModel[v3.Document], handlers map[string]HandlerCobra) error
Bootstraps a cobra.Command with the loaded model and a handler map
func BootstrapV3UrfaveCliV3 ¶
func BootstrapV3UrfaveCliV3(rootCmd *cli.Command, model libopenapi.DocumentModel[v3.Document], handlers map[string]HandlerUrfaveCliV3) error
Bootstraps a cli.Command with the loaded model and a handler map
func LoadFileV3 ¶
func LoadFileV3(path string) (*libopenapi.DocumentModel[v3.Document], error)
Loads and verifies an OpenAPI spec from a file path
func LoadV3 ¶
func LoadV3(data []byte) (*libopenapi.DocumentModel[v3.Document], error)
Loads and verifies an OpenAPI spec frpm an array of bytes
Types ¶
type Handler
deprecated
type Handler = HandlerCobra
Deprecated: Use HandlerCobra instead
type HandlerCobra ¶
type HandlerCobra func(opts *cobra.Command, args []string, data HandlerData) error
type HandlerData ¶
type HandlerData struct {
Method string // the HTTP method
Path string // the path with the path params filled in
PathParams []ParamMeta // List of path params
QueryParams []ParamMeta // List of query params
HeaderParams []ParamMeta // List of header params
CookieParams []ParamMeta // List of cookie params
RequestBodyParam *ParamMeta // The optional request body
}
Data passed into each handler
type HandlerUrfaveCliV3 ¶
type HandlerUrfaveCliV3 func(opts *cli.Command, args []string, data HandlerData) error
type OpenAPIType ¶
type OpenAPIType string
Currently supported OpenAPI types
const ( String OpenAPIType = "string" Number OpenAPIType = "number" Integer OpenAPIType = "integer" Boolean OpenAPIType = "boolean" )
Click to show internal directories.
Click to hide internal directories.