Documentation
¶
Index ¶
- func BodyNameTag(contentType string) string
- func BoolTag(value string) bool
- func FloatTag(value string) *float64
- func ForEachField(t reflect.Type, fn func(reflect.StructField))
- func IgnoredField(field reflect.StructField, key string) bool
- func IndirectType(t reflect.Type) reflect.Type
- func InferContentType(value any) string
- func IntTag(value string) *int
- func IsComponentType(t reflect.Type) bool
- func IsOpenAPI30(version string) bool
- func IsTime(t reflect.Type) bool
- func LowerCamel(value string) string
- func NormalizeTagValue(value any) any
- func ParseTagValue(value string) any
- func ParseTagValues(value string) []any
- func ParseTypeTag(value string, version string) any
- func SanitizeTypeName(name string) string
- func TagName(field reflect.StructField, key string) string
- type OneOfValue
- type Reflector
- func (r *Reflector) ApplyExclusiveLimit(schema *openapi.Schema, tag reflect.StructTag, key string)
- func (r *Reflector) ApplyNullable(schema *openapi.Schema, nullable bool)
- func (r *Reflector) ApplySchemaTags(schema *openapi.Schema, field reflect.StructField)
- func (r *Reflector) ApplyXMLTags(schema *openapi.Schema, tag reflect.StructTag)
- func (r *Reflector) InlineRefs() bool
- func (r *Reflector) ParameterField(field reflect.StructField) (string, string, bool)
- func (r *Reflector) ParameterSchema(field reflect.StructField, in, name string) *openapi.Parameter
- func (r *Reflector) RefSchema(t reflect.Type) (*openapi.Schema, error)
- func (r *Reflector) RequestParts(value any, ct string) ([]*openapi.Parameter, *openapi.Schema, error)
- func (r *Reflector) SchemaForType(t reflect.Type, mode SchemaMode, field *reflect.StructField) (*openapi.Schema, error)
- func (r *Reflector) SchemaForValue(value any, mode SchemaMode) (*openapi.Schema, error)
- func (r *Reflector) SchemaFromTypeExposer(t reflect.Type) *openapi.Schema
- func (r *Reflector) SchemaFromValueExposer(value any) *openapi.Schema
- func (r *Reflector) StripPrefixes() []string
- func (r *Reflector) StructSchema(t reflect.Type, nameTag string, onlyTagged bool, mode SchemaMode) (*openapi.Schema, error)
- func (r *Reflector) TypeName(t reflect.Type) string
- type SchemaExposer
- type SchemaMode
- type StaticSchemaExposer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BodyNameTag ¶
func ForEachField ¶
func ForEachField(t reflect.Type, fn func(reflect.StructField))
func IgnoredField ¶
func IgnoredField(field reflect.StructField, key string) bool
func InferContentType ¶ added in v0.5.1
InferContentType inspects struct tags on value to determine request body content type. Returns "multipart/form-data" if any field tagged `form` holds a file type, "application/x-www-form-urlencoded" if any `form` tag is present, or "" otherwise.
func IsComponentType ¶
func IsOpenAPI30 ¶
func LowerCamel ¶
func NormalizeTagValue ¶
func ParseTagValue ¶
func ParseTagValues ¶
func ParseTypeTag ¶
func SanitizeTypeName ¶
Types ¶
type OneOfValue ¶
type OneOfValue interface {
GetValues() []any
}
OneOfValue represents a reflected one-of union container.
type Reflector ¶
type Reflector struct {
Config *openapi.Config
Components map[string]*openapi.Schema
Names map[reflect.Type]string
Generating map[reflect.Type]bool
TypeMapping map[reflect.Type]reflect.Type
}
func NewReflector ¶
func (*Reflector) ApplyExclusiveLimit ¶
func (*Reflector) ApplyNullable ¶
func (*Reflector) ApplySchemaTags ¶
func (r *Reflector) ApplySchemaTags(schema *openapi.Schema, field reflect.StructField)
func (*Reflector) ApplyXMLTags ¶
func (*Reflector) InlineRefs ¶
func (*Reflector) ParameterField ¶
func (*Reflector) ParameterSchema ¶
func (*Reflector) RequestParts ¶
func (*Reflector) SchemaForType ¶
func (r *Reflector) SchemaForType( t reflect.Type, mode SchemaMode, field *reflect.StructField, ) (*openapi.Schema, error)
func (*Reflector) SchemaForValue ¶
func (*Reflector) SchemaFromTypeExposer ¶
func (*Reflector) SchemaFromValueExposer ¶
func (*Reflector) StripPrefixes ¶
func (*Reflector) StructSchema ¶
type SchemaExposer ¶
SchemaExposer lets a value provide an OpenAPI schema for a specific version.
type StaticSchemaExposer ¶
StaticSchemaExposer lets a value provide a version-independent OpenAPI schema.
Click to show internal directories.
Click to hide internal directories.