Documentation
¶
Overview ¶
Package lint provides deterministic linting for OpenAPI specifications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDefaults ¶
WithDefaults lints using vacuum's built-in recommended ruleset. This is useful when no custom APIStyleSpec is available.
Types ¶
type Linter ¶
type Linter interface {
// Lint analyzes an OpenAPI specification and returns violations.
Lint(ctx context.Context, spec []byte, opts *Options) (*types.LintReport, error)
}
Linter defines the interface for OpenAPI specification linting.
type Options ¶
type Options struct {
// FileName is the path to the specification file (for error reporting).
FileName string
// Profile is the style profile name being used.
Profile string
// ConformanceLevel is the target conformance level.
ConformanceLevel string
// FailFast stops on first error if true.
FailFast bool
// Timeout is the maximum duration for linting.
Timeout int
// Exceptions is a list of exceptions to apply.
Exceptions []types.Exception
}
Options configures linting behavior.
func DefaultOptions ¶
func DefaultOptions() *Options
DefaultOptions returns options with sensible defaults.
type VacuumLinter ¶
type VacuumLinter struct {
// contains filtered or unexported fields
}
VacuumLinter implements Linter using the vacuum library.
func NewVacuumLinter ¶
func NewVacuumLinter(spec *types.APIStyleSpec) *VacuumLinter
NewVacuumLinter creates a new linter from an APIStyleSpec.
func (*VacuumLinter) Lint ¶
func (l *VacuumLinter) Lint(_ context.Context, specBytes []byte, opts *Options) (*types.LintReport, error)
Lint analyzes an OpenAPI specification and returns violations.
Click to show internal directories.
Click to hide internal directories.