Documentation
¶
Overview ¶
Package requestgen turns a normalized OpenAPI spec into concrete HTTP requests, generating example values from schemas (ported/extended from BishopFox/sj).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateExample ¶
GenerateExample recursively produces an example value for a schema.
func ResolveBase ¶
ResolveBase returns the effective base URL Build will use: the explicit opts.BaseURL when set, otherwise the spec's server URL, trimmed of any trailing slash. Callers use it to avoid redundant re-scans against a base that matches the one already used.
Types ¶
type Options ¶
type Options struct {
TestString string
CustomURL string
CustomEmail string
CustomDate string
BaseURL string // overrides server URL when set
IncludeRisk bool // include non-GET methods
}
Options controls value generation.
type Request ¶
type Request struct {
Method string `json:"method"`
URL string `json:"url"`
Path string `json:"path"` // template path (for grouping)
Body string `json:"body,omitempty"`
ContentType string `json:"content_type,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
}
Request is a concrete generated HTTP request.
Click to show internal directories.
Click to hide internal directories.