openapi

package
v0.0.0-...-e2276be Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(fn func(Record) bool) openAPIOption

func Tags

func Tags(fn func(mason.Operation) []string, all []string) openAPIOption

func Transform

func Transform(fn func(*Record)) openAPIOption

func Validate

func Validate(skip bool) openAPIOption

Types

type ContextWrapper

type ContextWrapper struct {
	openapi.OperationContext
	*openapi31.Operation
	// contains filtered or unexported fields
}

func NewContextWrapper

func NewContextWrapper(ctx openapi.OperationContext, r *Reflector) *ContextWrapper

type Generator

type Generator struct {
	*Reflector
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(a *mason.API, opts ...openAPIOption) (*Generator, error)

func (*Generator) Schema

func (g *Generator) Schema() ([]byte, error)

type Record

type Record struct {
	Input           *mason.Model
	Output          mason.Model
	ID              string
	Method          string
	Path            string
	Description     string
	Summary         string
	SuccessStatus   int
	Tags            []string
	QueryParams     any
	Extensions      map[string]interface{}
	PathSummary     string
	PathDescription string
}

func (*Record) AddInputModel

func (r *Record) AddInputModel(m model.WithSchema)

func (*Record) AddOutputModel

func (r *Record) AddOutputModel(m model.WithSchema)

func (*Record) AddQueryParams

func (r *Record) AddQueryParams(q any)

type Reflector

type Reflector struct {
	*openapi31.Reflector
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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