config

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2025 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider uint8
const (
	ProviderSwaggerUI Provider = iota
	ProviderStoplightElements
	ProviderRedoc
)

type Redoc

type Redoc struct {
	HideDownload bool // Hides the "Download" button for saving the API definition source file.
}

Redoc holds the configuration for the Redoc.

type SpecGenerator

type SpecGenerator interface {
	MarshalYAML() ([]byte, error)
	MarshalJSON() ([]byte, error)
}

SpecGenerator is an interface for types that can generate OpenAPI specifications.

type SpecUI

type SpecUI struct {
	Title         string        // Title of the OpenAPI UI
	DocsPath      string        // Path to the OpenAPI UI documentation
	SpecFile      string        // Path to the OpenAPI specification file
	SpecPath      string        // Path to the OpenAPI specification, default is openapi.yaml
	SpecIOFS      fs.FS         // Filesystem for the OpenAPI specification
	SpecEmbedFS   *embed.FS     // Embedded file system for the OpenAPI specification
	SpecGenerator SpecGenerator // OpenAPI specification generator

	Provider          Provider          // Provider type
	Swagger           Swagger           // Swagger UI configuration
	StoplightElements StoplightElements // Stoplight Elements configuration
	Redoc             Redoc             // Redoc configuration
}

SpecUI holds the configuration for the OpenAPI UI.

type StoplightElements

type StoplightElements struct {
	HideExport  bool   // Hide the "Export" button on overview section of the documentation.
	HideSchemas bool   // Hide the schemas in the Table of Contents, when using the sidebar layout.
	HideTryIt   bool   // Hide "Try it" feature.
	Layout      string // Layout type, e.g. "sidebar" or "responsive".
	Router      string // Router type.
}

StoplightElements holds the configuration for the Stoplight Elements.

type Swagger

type Swagger struct {
	ShowTopBar         bool              // Show navigation top bar, hidden by default.
	HideCurl           bool              // Hide curl code snippet.
	JsonEditor         bool              // Enable visual json editor support (experimental, can fail with complex schemas).
	PreAuthorizeApiKey map[string]string // Map of security name to key value.

	// SettingsUI contains keys and plain javascript values of SwaggerUIBundle configuration.
	// Overrides default values.
	// See https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/ for available options.
	SettingsUI map[string]string
}

Swagger holds the configuration for the Swagger UI.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL