Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenAPIDoc ¶
type OpenAPIDoc struct {
OpenAPI string `json:"openapi" yaml:"openapi"`
Swagger string `json:"swagger" yaml:"swagger"`
Info struct {
Title string `json:"title" yaml:"title"`
Version string `json:"version" yaml:"version"`
Description string `json:"description" yaml:"description"`
} `json:"info" yaml:"info"`
Paths map[string]PathItem `json:"paths" yaml:"paths"`
}
OpenAPIDoc represents a parsed OpenAPI v3 or Swagger v2 document.
type Operation ¶
type Operation struct {
Summary string `json:"summary" yaml:"summary"`
Description string `json:"description" yaml:"description"`
Parameters []Parameter `json:"parameters" yaml:"parameters"`
Responses map[string]Response `json:"responses" yaml:"responses"`
}
Operation defines an HTTP operation for a path in OpenAPI.
type Parameter ¶
type Parameter struct {
Name string `json:"name" yaml:"name"`
In string `json:"in" yaml:"in"` // "query", "header", "path"
Required bool `json:"required" yaml:"required"`
}
Parameter defines a parameter in an OpenAPI operation.
type PathItem ¶
type PathItem struct {
Get *Operation `json:"get" yaml:"get"`
Post *Operation `json:"post" yaml:"post"`
Put *Operation `json:"put" yaml:"put"`
Delete *Operation `json:"delete" yaml:"delete"`
Patch *Operation `json:"patch" yaml:"patch"`
Options *Operation `json:"options" yaml:"options"`
Head *Operation `json:"head" yaml:"head"`
}
PathItem defines the operations for an OpenAPI path template.
func (*PathItem) GetOperation ¶
type Response ¶
type Response struct {
Description string `json:"description" yaml:"description"`
}
Response defines an expected HTTP response.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates intercepted HTTP traffic against an OpenAPI / Swagger contract.
func NewValidator ¶
func NewValidator() *Validator
NewValidator initializes a new OpenAPI contract validator.
func (*Validator) Evaluate ¶
func (v *Validator) Evaluate(event *ringbuffer.TrafficEvent) []*analysis.Finding
Evaluate implements analysis.Rule for automated contract drift detection.
Click to show internal directories.
Click to hide internal directories.