Documentation
¶
Overview ¶
Package openapi loads an OpenAPI document and checks that writgate can serve it: OpenAPI 3.0.x or 3.1.x, with remote $refs off unless asked for.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSwagger2 = errors.New("swagger 2.0 is not supported: convert the spec to OpenAPI 3.x first")
ErrSwagger2 is returned for a Swagger 2.0 document.
var ErrUnsupportedVersion = errors.New("unsupported OpenAPI version: writgate accepts 3.0.x and 3.1.x")
ErrUnsupportedVersion is returned for an OpenAPI version other than 3.0 or 3.1.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// BasePath is the directory that relative file $refs resolve against.
// Empty means file $refs are not followed.
BasePath string
// AllowRemoteRefs lets the loader fetch $refs over HTTP(S). Off by
// default, so loading a spec never makes a network call on its own.
AllowRemoteRefs bool
// Logger receives libopenapi's warnings. Nil means stderr. It must never
// be stdout, which is the MCP channel in stdio mode.
Logger *slog.Logger
}
Options controls how a spec is loaded.