builder

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyContentExamples

func ApplyContentExamples(mediaType *openapi.MediaType, cu *openapi.ContentUnit)

func ComponentsEmpty

func ComponentsEmpty(components *openapi.Components) bool

func ContentType

func ContentType(cu *openapi.ContentUnit) string

func MergeResponses

func MergeResponses(responses []*openapi.ContentUnit) []*openapi.ContentUnit

func OneOf

func OneOf(values ...any) any

func ResponseDescription

func ResponseDescription(cu *openapi.ContentUnit) string

func SecurityRequirement

func SecurityRequirement(name string, scopes []string) openapi.SecurityRequirement

func SetOperation

func SetOperation(item *openapi.PathItem, method string, op *openapi.Operation, version string) error

Types

type Builder

type Builder struct {
	Config    *openapi.Config
	Doc       *openapi.Document
	Reflector *reflect.Reflector
}

func NewBuilder

func NewBuilder(cfg *openapi.Config, doc *openapi.Document) *Builder

func (*Builder) AddOperation

func (b *Builder) AddOperation(method, path string, opts []option.OperationOption) error

func (*Builder) AddOperationTo

func (b *Builder) AddOperationTo(
	method, target string,
	opts []option.OperationOption,
	items map[string]*openapi.PathItem,
) error

func (*Builder) AddRequest

func (b *Builder) AddRequest(op *openapi.Operation, cu *openapi.ContentUnit)

func (*Builder) AddResponse

func (b *Builder) AddResponse(op *openapi.Operation, cu *openapi.ContentUnit) error

func (*Builder) AddWebhookOperation

func (b *Builder) AddWebhookOperation(method, name string, opts []option.OperationOption) error

func (*Builder) Finish

func (b *Builder) Finish()

type ResponseKey

type ResponseKey struct {
	Status      int
	ContentType string
	IsDefault   bool
}

Jump to

Keyboard shortcuts

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