Documentation ¶
Index ¶
- Variables
- func ExtractOpenAPI3Scheme(domain string) (*openapi3.T, error)
- func GenerateHTTPFlows(doc string, opt ...Option) error
- func OpenAPIToHTTPFlow(t string)
- func OpenAPITypeToMockDataLiteral(t string, defaults ...any) any
- func ValueViaField(field string, t string, defaults ...any) any
- type OpenAPIConfig
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var Exports = map[string]any{ "GenerateHTTPFlows": GenerateHTTPFlows, "ExtractOpenAPI3Scheme": ExtractOpenAPI3Scheme, "ConvertJsonToYaml": openapiyaml.JSONToYAML, "ConvertYamlToJson": openapiyaml.YAMLToJSON, "https": WithHttps, "flowHandler": WithFlowHandler, "domain": WithDomain, }
Functions ¶
func ExtractOpenAPI3Scheme ¶ added in v1.3.3
ExtractOpenAPI3Scheme fetch openapi3 scheme from yakit.HTTPFlows Example:
scheme := openapi.ExtractOpenAPI3Scheme(domain)~ schemeJSON = scheme.MarshalJSON()~
func GenerateHTTPFlows ¶ added in v1.3.3
GenerateHTTPFlows means generate yakit.HTTPFlow via openapi2/3 scheme use WithFlowHandler to recv and handle it Example:
openapi.Generate(fileName, openapi.flowHandler(flow => { dump(flow.Url) }))
func OpenAPIToHTTPFlow ¶
func OpenAPIToHTTPFlow(t string)
Types ¶
type OpenAPIConfig ¶
func NewDefaultOpenAPIConfig ¶
func NewDefaultOpenAPIConfig() *OpenAPIConfig
type Option ¶
type Option func(config *OpenAPIConfig)
func WithFlowHandler ¶
WithFlowHandler means use this handler
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package openapi2 parses and writes OpenAPIv2 specification documents.
|
Package openapi2 parses and writes OpenAPIv2 specification documents. |
Package openapi3 parses and writes OpenAPI 3 specification documents.
|
Package openapi3 parses and writes OpenAPI 3 specification documents. |
Click to show internal directories.
Click to hide internal directories.