openapi

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	OAuthParamTokenURL     = "token_url"
	OAuthParamAuthURL      = "auth_url"
	OAuthParamRedirectURI  = "redirect_uri"
	OAuthParamClientID     = "client_id"
	OAuthParamClientSecret = "client_secret"
	OAuthParamScope        = "scope"
	OAuthParamAudience     = "audience"
	OAuthParamResource     = "resource"
	OAuthParamGrant        = "grant"
	OAuthParamUsername     = "username"
	OAuthParamPassword     = "password"
	OAuthParamClientAuth   = "client_auth"
	OAuthParamCacheKey     = "cache_key"
	OAuthParamCodeVerifier = "code_verifier"
	OAuthParamCodeMethod   = "code_challenge_method"
	OAuthParamState        = "state"
)
View Source
const (
	OAuthGrantClientCredentials = "client_credentials"
	OAuthGrantPassword          = "password"
	OAuthGrantAuthorizationCode = "authorization_code"
)
View Source
const (
	DefaultBaseURLVariable = "baseUrl"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DocumentWriter

type DocumentWriter interface {
	WriteDocument(
		ctx context.Context,
		doc *restfile.Document,
		destination string,
		opts WriterOptions,
	) error
}

type GenerateOptions

type GenerateOptions struct {
	Parse    ParseOptions
	Generate GeneratorOptions
	Write    WriterOptions
}

type GenerationMode added in v0.47.1

type GenerationMode string
const (
	GenerationRequests GenerationMode = "requests"
	GenerationMocks    GenerationMode = "mocks"
	GenerationBoth     GenerationMode = "both"
)

func ParseGenerationMode added in v0.47.1

func ParseGenerationMode(raw string) (GenerationMode, error)

type Generator

type Generator interface {
	Generate(
		ctx context.Context,
		spec *model.Spec,
		opts GeneratorOptions,
	) (*restfile.Document, error)
}

type GeneratorOptions

type GeneratorOptions struct {
	BaseURLVariable      string
	IncludeDeprecated    bool
	PreferredServerIndex int
	Mode                 GenerationMode
}

type ParseOptions

type ParseOptions struct {
	ResolveExternalRefs bool
}

type Parser

type Parser interface {
	Parse(ctx context.Context, path string, opts ParseOptions) (*model.Spec, error)
}

type Service

type Service struct {
	Parser    Parser
	Generator Generator
	Writer    DocumentWriter
}

func (*Service) GenerateHTTPFile

func (s *Service) GenerateHTTPFile(
	ctx context.Context,
	specPath, outputPath string,
	opts GenerateOptions,
) error

type Warner added in v0.23.4

type Warner interface {
	Warnings() []string
}

type WriterOptions

type WriterOptions struct {
	OverwriteExisting bool
	HeaderComment     string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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