schema

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSchema = errors.New("codescan:builders:schema")

ErrSchema is the sentinel error for all errors originating from the schema builder package.

Functions

func BodyTypable

func BodyTypable(in string, schema *oaispec.Schema, skipExt bool) (ifaces.SwaggerTypable, *oaispec.Schema)

Types

type Builder

type Builder struct {
	GoName string
	Name   string
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(ctx *scanner.ScanCtx, decl *scanner.EntityDecl) *Builder

func (*Builder) Build

func (s *Builder) Build(definitions map[string]oaispec.Schema) error

func (*Builder) BuildFromType

func (s *Builder) BuildFromType(tpe types.Type, tgt ifaces.SwaggerTypable) error

func (*Builder) InferNames

func (s *Builder) InferNames()

func (*Builder) PostDeclarations

func (s *Builder) PostDeclarations() []*scanner.EntityDecl

func (*Builder) SetDiscovered

func (s *Builder) SetDiscovered(discovered []*scanner.EntityDecl)

type Typable

type Typable struct {
	// contains filtered or unexported fields
}

func NewTypable

func NewTypable(schema *oaispec.Schema, level int, skipExt bool) Typable

func (Typable) AddExtension

func (st Typable) AddExtension(key string, value any)

func (Typable) AdditionalProperties

func (st Typable) AdditionalProperties() ifaces.SwaggerTypable

func (Typable) In

func (st Typable) In() string

func (Typable) Items

func (st Typable) Items() ifaces.SwaggerTypable

func (Typable) Level

func (st Typable) Level() int

func (Typable) Schema

func (st Typable) Schema() *oaispec.Schema

func (Typable) SetRef

func (st Typable) SetRef(ref oaispec.Ref)

func (Typable) Typed

func (st Typable) Typed(tpe, format string)

func (Typable) WithEnum

func (st Typable) WithEnum(values ...any)

func (Typable) WithEnumDescription

func (st Typable) WithEnumDescription(desc string)

Jump to

Keyboard shortcuts

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