output

package
v0.0.0-...-e87c2fb Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DateFormat = "2006-01-02"

Variables

View Source
var ErrNullableIsNull = errors.New("nullable value is null")

ErrNullableIsNull is returned when trying to get a value from a null Nullable.

View Source
var ErrNullableNotSpecified = errors.New("nullable value is not specified")

ErrNullableNotSpecified is returned when trying to get a value from an unspecified Nullable.

View Source
var ErrValidationEmail = errors.New("email: failed to pass regex validation")

ErrValidationEmail is the sentinel error returned when an email fails validation

Functions

func GetOpenAPISpecJSON

func GetOpenAPISpecJSON() ([]byte, error)

GetOpenAPISpecJSON returns the raw OpenAPI spec as JSON bytes.

Types

type AdditionalPropsAny

type AdditionalPropsAny = map[string]any

#/components/schemas/AdditionalPropsAny

type AdditionalPropsNone

type AdditionalPropsNone struct {
	Known                *string        `form:"known,omitempty" json:"known,omitempty"`
	AdditionalProperties map[string]any `json:"-"`
}

#/components/schemas/AdditionalPropsNone

func (*AdditionalPropsNone) ApplyDefaults

func (s *AdditionalPropsNone) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (AdditionalPropsNone) MarshalJSON

func (s AdditionalPropsNone) MarshalJSON() ([]byte, error)

func (*AdditionalPropsNone) UnmarshalJSON

func (s *AdditionalPropsNone) UnmarshalJSON(data []byte) error

type AdditionalPropsObject

type AdditionalPropsObject = map[string]any

#/components/schemas/AdditionalPropsObject

type AdditionalPropsTyped

type AdditionalPropsTyped = map[string]int

#/components/schemas/AdditionalPropsTyped

type AdditionalPropsWithProps

type AdditionalPropsWithProps struct {
	ID                   *int              `form:"id,omitempty" json:"id,omitempty"`
	AdditionalProperties map[string]string `json:"-"`
}

#/components/schemas/AdditionalPropsWithProps

func (*AdditionalPropsWithProps) ApplyDefaults

func (s *AdditionalPropsWithProps) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (AdditionalPropsWithProps) MarshalJSON

func (s AdditionalPropsWithProps) MarshalJSON() ([]byte, error)

func (*AdditionalPropsWithProps) UnmarshalJSON

func (s *AdditionalPropsWithProps) UnmarshalJSON(data []byte) error

type AllOfInlineOnly

type AllOfInlineOnly struct {
	First  *string `form:"first,omitempty" json:"first,omitempty"`
	Second *int    `form:"second,omitempty" json:"second,omitempty"`
}

#/components/schemas/AllOfInlineOnly

func (*AllOfInlineOnly) ApplyDefaults

func (s *AllOfInlineOnly) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type AllOfMultipleRefs

type AllOfMultipleRefs struct {
	ID        int        `form:"id" json:"id"`
	CreatedAt *time.Time `form:"createdAt,omitempty" json:"createdAt,omitempty"`
	Name      *string    `form:"name,omitempty" json:"name,omitempty"`
	Merged    *bool      `form:"merged,omitempty" json:"merged,omitempty"`
}

#/components/schemas/AllOfMultipleRefs

func (*AllOfMultipleRefs) ApplyDefaults

func (s *AllOfMultipleRefs) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type AllOfWithOneOf

type AllOfWithOneOf struct {
	ID                   *int                  `form:"id,omitempty" json:"id,omitempty"`
	CreatedAt            *time.Time            `form:"createdAt,omitempty" json:"createdAt,omitempty"`
	AllOfWithOneOfAllOf1 *AllOfWithOneOfAllOf1 `json:"-"`
}

#/components/schemas/AllOfWithOneOf

func (*AllOfWithOneOf) ApplyDefaults

func (s *AllOfWithOneOf) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (AllOfWithOneOf) MarshalJSON

func (s AllOfWithOneOf) MarshalJSON() ([]byte, error)

func (*AllOfWithOneOf) UnmarshalJSON

func (s *AllOfWithOneOf) UnmarshalJSON(data []byte) error

type AllOfWithOneOfAllOf1

type AllOfWithOneOfAllOf1 struct {
	Cat *Cat
	Dog *Dog
}

#/components/schemas/AllOfWithOneOf/allOf/1

func (*AllOfWithOneOfAllOf1) ApplyDefaults

func (u *AllOfWithOneOfAllOf1) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (AllOfWithOneOfAllOf1) MarshalJSON

func (u AllOfWithOneOfAllOf1) MarshalJSON() ([]byte, error)

func (*AllOfWithOneOfAllOf1) UnmarshalJSON

func (u *AllOfWithOneOfAllOf1) UnmarshalJSON(data []byte) error

type AllTypesOptional

type AllTypesOptional struct {
	IntField      *int       `form:"intField,omitempty" json:"intField,omitempty"`
	Int32Field    *int32     `form:"int32Field,omitempty" json:"int32Field,omitempty"`
	Int64Field    *int64     `form:"int64Field,omitempty" json:"int64Field,omitempty"`
	FloatField    *float32   `form:"floatField,omitempty" json:"floatField,omitempty"`
	DoubleField   *float64   `form:"doubleField,omitempty" json:"doubleField,omitempty"`
	NumberField   *float32   `form:"numberField,omitempty" json:"numberField,omitempty"`
	StringField   *string    `form:"stringField,omitempty" json:"stringField,omitempty"`
	BoolField     *bool      `form:"boolField,omitempty" json:"boolField,omitempty"`
	DateField     *Date      `form:"dateField,omitempty" json:"dateField,omitempty"`
	DateTimeField *time.Time `form:"dateTimeField,omitempty" json:"dateTimeField,omitempty"`
	UUIDField     *UUID      `form:"uuidField,omitempty" json:"uuidField,omitempty"`
	EmailField    *Email     `form:"emailField,omitempty" json:"emailField,omitempty"`
}

#/components/schemas/AllTypesOptional

func (*AllTypesOptional) ApplyDefaults

func (s *AllTypesOptional) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type AllTypesRequired

type AllTypesRequired struct {
	IntField      int       `form:"intField" json:"intField"`
	Int32Field    int32     `form:"int32Field" json:"int32Field"`
	Int64Field    int64     `form:"int64Field" json:"int64Field"`
	FloatField    float32   `form:"floatField" json:"floatField"`
	DoubleField   float64   `form:"doubleField" json:"doubleField"`
	NumberField   float32   `form:"numberField" json:"numberField"`
	StringField   string    `form:"stringField" json:"stringField"`
	BoolField     bool      `form:"boolField" json:"boolField"`
	DateField     Date      `form:"dateField" json:"dateField"`
	DateTimeField time.Time `form:"dateTimeField" json:"dateTimeField"`
	UUIDField     UUID      `form:"uuidField" json:"uuidField"`
	EmailField    Email     `form:"emailField" json:"emailField"`
	URIField      string    `form:"uriField" json:"uriField"`
	HostnameField string    `form:"hostnameField" json:"hostnameField"`
	Ipv4Field     string    `form:"ipv4Field" json:"ipv4Field"`
	Ipv6Field     string    `form:"ipv6Field" json:"ipv6Field"`
	ByteField     []byte    `form:"byteField" json:"byteField"`
	BinaryField   File      `form:"binaryField" json:"binaryField"`
	PasswordField string    `form:"passwordField" json:"passwordField"`
}

#/components/schemas/AllTypesRequired

func (*AllTypesRequired) ApplyDefaults

func (s *AllTypesRequired) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type AnyOfMixed

type AnyOfMixed struct {
	String0          *string
	SimpleObject     *SimpleObject
	AnyOfMixedAnyOf2 *AnyOfMixedAnyOf2
}

#/components/schemas/AnyOfMixed

func (*AnyOfMixed) ApplyDefaults

func (u *AnyOfMixed) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (AnyOfMixed) MarshalJSON

func (u AnyOfMixed) MarshalJSON() ([]byte, error)

func (*AnyOfMixed) UnmarshalJSON

func (u *AnyOfMixed) UnmarshalJSON(data []byte) error

type AnyOfMixedAnyOf2

type AnyOfMixedAnyOf2 struct {
	Inline *bool `form:"inline,omitempty" json:"inline,omitempty"`
}

#/components/schemas/AnyOfMixed/anyOf/2

func (*AnyOfMixedAnyOf2) ApplyDefaults

func (s *AnyOfMixedAnyOf2) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type AnyOfNullable

type AnyOfNullable = Nullable[string]

#/components/schemas/AnyOfNullable

type AnyOfObjects

type AnyOfObjects struct {
	SimpleObject   *SimpleObject
	BaseProperties *BaseProperties
}

#/components/schemas/AnyOfObjects

func (*AnyOfObjects) ApplyDefaults

func (u *AnyOfObjects) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (AnyOfObjects) MarshalJSON

func (u AnyOfObjects) MarshalJSON() ([]byte, error)

func (*AnyOfObjects) UnmarshalJSON

func (u *AnyOfObjects) UnmarshalJSON(data []byte) error

type AnyOfPrimitives

type AnyOfPrimitives struct {
	String0 *string
	Int1    *int
}

#/components/schemas/AnyOfPrimitives

func (*AnyOfPrimitives) ApplyDefaults

func (u *AnyOfPrimitives) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (AnyOfPrimitives) MarshalJSON

func (u AnyOfPrimitives) MarshalJSON() ([]byte, error)

func (*AnyOfPrimitives) UnmarshalJSON

func (u *AnyOfPrimitives) UnmarshalJSON(data []byte) error

type AnyValue

type AnyValue = any

#/components/schemas/AnyValue Accepts any JSON value

type ArrayOfAnyOf

type ArrayOfAnyOf = []ArrayOfAnyOfItem

#/components/schemas/ArrayOfAnyOf

type ArrayOfAnyOfItem

type ArrayOfAnyOfItem struct {
	SimpleObject   *SimpleObject
	BaseProperties *BaseProperties
}

#/components/schemas/ArrayOfAnyOf/items

func (*ArrayOfAnyOfItem) ApplyDefaults

func (u *ArrayOfAnyOfItem) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (ArrayOfAnyOfItem) MarshalJSON

func (u ArrayOfAnyOfItem) MarshalJSON() ([]byte, error)

func (*ArrayOfAnyOfItem) UnmarshalJSON

func (u *ArrayOfAnyOfItem) UnmarshalJSON(data []byte) error

type ArrayTypes

type ArrayTypes struct {
	StringArray          []string                          `form:"stringArray,omitempty" json:"stringArray,omitempty"`
	IntArray             []int                             `form:"intArray,omitempty" json:"intArray,omitempty"`
	ObjectArray          []SimpleObject                    `form:"objectArray,omitempty" json:"objectArray,omitempty"`
	InlineObjectArray    []ArrayTypesInlineObjectArrayItem `form:"inlineObjectArray,omitempty" json:"inlineObjectArray,omitempty"`
	NestedArray          [][]string                        `form:"nestedArray,omitempty" json:"nestedArray,omitempty"`
	NullableArray        []string                          `form:"nullableArray,omitempty" json:"nullableArray,omitempty"`
	ArrayWithConstraints []string                          `form:"arrayWithConstraints,omitempty" json:"arrayWithConstraints,omitempty"`
}

#/components/schemas/ArrayTypes

func (*ArrayTypes) ApplyDefaults

func (s *ArrayTypes) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type ArrayTypesInlineObjectArray

type ArrayTypesInlineObjectArray = []ArrayTypesInlineObjectArrayItem

#/components/schemas/ArrayTypes/properties/inlineObjectArray

type ArrayTypesInlineObjectArrayItem

type ArrayTypesInlineObjectArrayItem struct {
	ID   *int    `form:"id,omitempty" json:"id,omitempty"`
	Name *string `form:"name,omitempty" json:"name,omitempty"`
}

#/components/schemas/ArrayTypes/properties/inlineObjectArray/items

func (*ArrayTypesInlineObjectArrayItem) ApplyDefaults

func (s *ArrayTypesInlineObjectArrayItem) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type ArrayTypesObjectArray

type ArrayTypesObjectArray = []SimpleObject

#/components/schemas/ArrayTypes/properties/objectArray

type BaseProperties

type BaseProperties struct {
	ID        *int       `form:"id,omitempty" json:"id,omitempty"`
	CreatedAt *time.Time `form:"createdAt,omitempty" json:"createdAt,omitempty"`
}

#/components/schemas/BaseProperties

func (*BaseProperties) ApplyDefaults

func (s *BaseProperties) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type Cat

type Cat struct {
	PetType       string   `form:"petType" json:"petType"`
	Meow          string   `form:"meow" json:"meow"`
	WhiskerLength *float32 `form:"whiskerLength,omitempty" json:"whiskerLength,omitempty"`
}

#/components/schemas/Cat

func (*Cat) ApplyDefaults

func (s *Cat) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type ComplexNested

type ComplexNested struct {
	Metadata map[string]any          `form:"metadata,omitempty" json:"metadata,omitempty"`
	Items    []ComplexNestedItemItem `form:"items,omitempty" json:"items,omitempty"`
	Config   *ComplexNestedConfig    `form:"config,omitempty" json:"config,omitempty"`
}

#/components/schemas/ComplexNested

func (*ComplexNested) ApplyDefaults

func (s *ComplexNested) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type ComplexNestedConfig

type ComplexNestedConfig struct {
	ComplexNestedConfigOneOf0 *ComplexNestedConfigOneOf0
	ComplexNestedConfigOneOf1 *ComplexNestedConfigOneOf1
}

#/components/schemas/ComplexNested/properties/config

func (*ComplexNestedConfig) ApplyDefaults

func (u *ComplexNestedConfig) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (ComplexNestedConfig) MarshalJSON

func (u ComplexNestedConfig) MarshalJSON() ([]byte, error)

func (*ComplexNestedConfig) UnmarshalJSON

func (u *ComplexNestedConfig) UnmarshalJSON(data []byte) error

type ComplexNestedConfigOneOf0

type ComplexNestedConfigOneOf0 struct {
	Mode  *string `form:"mode,omitempty" json:"mode,omitempty"`
	Value *string `form:"value,omitempty" json:"value,omitempty"`
}

#/components/schemas/ComplexNested/properties/config/oneOf/0

func (*ComplexNestedConfigOneOf0) ApplyDefaults

func (s *ComplexNestedConfigOneOf0) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type ComplexNestedConfigOneOf1

type ComplexNestedConfigOneOf1 struct {
	Mode    *string           `form:"mode,omitempty" json:"mode,omitempty"`
	Options map[string]string `form:"options,omitempty" json:"options,omitempty"`
}

#/components/schemas/ComplexNested/properties/config/oneOf/1

func (*ComplexNestedConfigOneOf1) ApplyDefaults

func (s *ComplexNestedConfigOneOf1) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type ComplexNestedConfigOneOf1Options

type ComplexNestedConfigOneOf1Options = map[string]string

#/components/schemas/ComplexNested/properties/config/oneOf/1/properties/options

type ComplexNestedItem

type ComplexNestedItem = []ComplexNestedItemItem

#/components/schemas/ComplexNested/properties/items

type ComplexNestedItemItem

type ComplexNestedItemItem struct {
	ID        *int       `form:"id,omitempty" json:"id,omitempty"`
	CreatedAt *time.Time `form:"createdAt,omitempty" json:"createdAt,omitempty"`
	Tags      []string   `form:"tags,omitempty" json:"tags,omitempty"`
}

#/components/schemas/ComplexNested/properties/items/items

func (*ComplexNestedItemItem) ApplyDefaults

func (s *ComplexNestedItemItem) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type ComplexNestedMetadata

type ComplexNestedMetadata = map[string]any

#/components/schemas/ComplexNested/properties/metadata

type ComplexNestedMetadataValue

type ComplexNestedMetadataValue struct {
	String0         *string
	Int1            *int
	LBracketString2 *[]string
}

#/components/schemas/ComplexNested/properties/metadata/additionalProperties

func (*ComplexNestedMetadataValue) ApplyDefaults

func (u *ComplexNestedMetadataValue) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (ComplexNestedMetadataValue) MarshalJSON

func (u ComplexNestedMetadataValue) MarshalJSON() ([]byte, error)

func (*ComplexNestedMetadataValue) UnmarshalJSON

func (u *ComplexNestedMetadataValue) UnmarshalJSON(data []byte) error

type Date

type Date struct {
	time.Time
}

func (Date) Format

func (d Date) Format(layout string) string

Format returns the date formatted according to layout.

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (Date) MarshalText

func (d Date) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler for Date.

func (Date) String

func (d Date) String() string

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(data []byte) error

func (*Date) UnmarshalText

func (d *Date) UnmarshalText(data []byte) error

type DeepInheritance

type DeepInheritance struct {
	ID          *int       `form:"id,omitempty" json:"id,omitempty"`
	CreatedAt   *time.Time `form:"createdAt,omitempty" json:"createdAt,omitempty"`
	Name        string     `form:"name" json:"name"`
	Description *string    `form:"description,omitempty" json:"description,omitempty"`
	Extra       *string    `form:"extra,omitempty" json:"extra,omitempty"`
}

#/components/schemas/DeepInheritance

func (*DeepInheritance) ApplyDefaults

func (s *DeepInheritance) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type Dog

type Dog struct {
	PetType    string   `form:"petType" json:"petType"`
	Bark       string   `form:"bark" json:"bark"`
	TailLength *float32 `form:"tailLength,omitempty" json:"tailLength,omitempty"`
}

#/components/schemas/Dog

func (*Dog) ApplyDefaults

func (s *Dog) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type Email

type Email string

Email represents an email address. It is a string type that must pass regex validation before being marshalled to JSON or unmarshalled from JSON.

func (Email) MarshalJSON

func (e Email) MarshalJSON() ([]byte, error)

func (*Email) UnmarshalJSON

func (e *Email) UnmarshalJSON(data []byte) error

type EmptySchema

type EmptySchema = any

#/components/schemas/EmptySchema

type ExplicitAny

type ExplicitAny = Nullable[string]

#/components/schemas/ExplicitAny

type ExtendedObject

type ExtendedObject struct {
	ID          *int       `form:"id,omitempty" json:"id,omitempty"`
	CreatedAt   *time.Time `form:"createdAt,omitempty" json:"createdAt,omitempty"`
	Name        string     `form:"name" json:"name"`
	Description *string    `form:"description,omitempty" json:"description,omitempty"`
}

#/components/schemas/ExtendedObject

func (*ExtendedObject) ApplyDefaults

func (s *ExtendedObject) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type File

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

func (File) Bytes

func (file File) Bytes() ([]byte, error)

func (File) FileSize

func (file File) FileSize() int64

func (File) Filename

func (file File) Filename() string

func (*File) InitFromBytes

func (file *File) InitFromBytes(data []byte, filename string)

func (*File) InitFromMultipart

func (file *File) InitFromMultipart(header *multipart.FileHeader)

func (File) MarshalJSON

func (file File) MarshalJSON() ([]byte, error)

func (File) Reader

func (file File) Reader() (io.ReadCloser, error)

func (*File) UnmarshalJSON

func (file *File) UnmarshalJSON(data []byte) error

type GetInlineResponseJSONResponse

type GetInlineResponseJSONResponse struct {
	ID   int    `form:"id" json:"id"`
	Name string `form:"name" json:"name"`
}

#/paths//inline-response/get/responses/200/content/application/json/schema

func (*GetInlineResponseJSONResponse) ApplyDefaults

func (s *GetInlineResponseJSONResponse) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type InlineEnumInProperty

type InlineEnumInProperty struct {
	InlineStatus *string `form:"inlineStatus,omitempty" json:"inlineStatus,omitempty"`
}

#/components/schemas/InlineEnumInProperty

func (*InlineEnumInProperty) ApplyDefaults

func (s *InlineEnumInProperty) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type InlineEnumInPropertyInlineStatus

type InlineEnumInPropertyInlineStatus string

#/components/schemas/InlineEnumInProperty/properties/inlineStatus

type IntegerEnum

type IntegerEnum int

#/components/schemas/IntegerEnum

const (
	IntegerEnumN1 IntegerEnum = 1
	IntegerEnumN2 IntegerEnum = 2
	IntegerEnumN3 IntegerEnum = 3
)

type LinkedListNode

type LinkedListNode struct {
	Value *int            `form:"value,omitempty" json:"value,omitempty"`
	Next  *LinkedListNode `form:"next,omitempty" json:"next,omitempty"`
}

#/components/schemas/LinkedListNode

func (*LinkedListNode) ApplyDefaults

func (s *LinkedListNode) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type NestedMap

type NestedMap = map[string]map[string]string

#/components/schemas/NestedMap

type NestedMapValue

type NestedMapValue = map[string]string

#/components/schemas/NestedMap/additionalProperties

type NestedObject

type NestedObject struct {
	Outer *NestedObjectOuter `form:"outer,omitempty" json:"outer,omitempty"`
}

#/components/schemas/NestedObject

func (*NestedObject) ApplyDefaults

func (s *NestedObject) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type NestedObjectOuter

type NestedObjectOuter struct {
	Inner *NestedObjectOuterInner `form:"inner,omitempty" json:"inner,omitempty"`
}

#/components/schemas/NestedObject/properties/outer

func (*NestedObjectOuter) ApplyDefaults

func (s *NestedObjectOuter) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type NestedObjectOuterInner

type NestedObjectOuterInner struct {
	Value *string `form:"value,omitempty" json:"value,omitempty"`
}

#/components/schemas/NestedObject/properties/outer/properties/inner

func (*NestedObjectOuterInner) ApplyDefaults

func (s *NestedObjectOuterInner) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type Nullable

type Nullable[T any] map[bool]T

Nullable is a generic type that can distinguish between: - Field not provided (unspecified) - Field explicitly set to null - Field has a value

This is implemented as a map[bool]T where: - Empty map: unspecified - map[false]T: explicitly null - map[true]T: has a value

func NewNullNullable

func NewNullNullable[T any]() Nullable[T]

NewNullNullable creates a Nullable that is explicitly null.

func NewNullableWithValue

func NewNullableWithValue[T any](value T) Nullable[T]

NewNullableWithValue creates a Nullable with the given value.

func (Nullable[T]) Get

func (n Nullable[T]) Get() (T, error)

Get returns the value if set, or an error if null or unspecified.

func (Nullable[T]) IsNull

func (n Nullable[T]) IsNull() bool

IsNull returns true if the field is explicitly null.

func (Nullable[T]) IsSpecified

func (n Nullable[T]) IsSpecified() bool

IsSpecified returns true if the field was provided (either null or a value).

func (Nullable[T]) MarshalJSON

func (n Nullable[T]) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (Nullable[T]) MustGet

func (n Nullable[T]) MustGet() T

MustGet returns the value or panics if null or unspecified.

func (*Nullable[T]) Set

func (n *Nullable[T]) Set(value T)

Set assigns a value.

func (*Nullable[T]) SetNull

func (n *Nullable[T]) SetNull()

SetNull marks the field as explicitly null.

func (*Nullable[T]) SetUnspecified

func (n *Nullable[T]) SetUnspecified()

SetUnspecified clears the field (as if it was never set).

func (*Nullable[T]) UnmarshalJSON

func (n *Nullable[T]) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type NullableOptional

type NullableOptional struct {
	NullableString Nullable[string] `form:"nullableString,omitempty" json:"nullableString,omitempty"`
	NullableInt    Nullable[int]    `form:"nullableInt,omitempty" json:"nullableInt,omitempty"`
}

#/components/schemas/NullableOptional

func (*NullableOptional) ApplyDefaults

func (s *NullableOptional) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type NullableRefAnyOf

type NullableRefAnyOf struct {
	NullableObject Nullable[SimpleObject] `form:"nullableObject" json:"nullableObject"`
}

#/components/schemas/NullableRefAnyOf

func (*NullableRefAnyOf) ApplyDefaults

func (s *NullableRefAnyOf) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type NullableRefOneOf

type NullableRefOneOf struct {
	NullableObject         Nullable[SimpleObject] `form:"nullableObject" json:"nullableObject"`
	NullableObjectOptional Nullable[SimpleObject] `form:"nullableObjectOptional,omitempty" json:"nullableObjectOptional,omitempty"`
}

#/components/schemas/NullableRefOneOf

func (*NullableRefOneOf) ApplyDefaults

func (s *NullableRefOneOf) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type NullableRequired

type NullableRequired struct {
	NullableString Nullable[string]                         `form:"nullableString" json:"nullableString"`
	NullableInt    Nullable[int]                            `form:"nullableInt" json:"nullableInt"`
	NullableObject Nullable[NullableRequiredNullableObject] `form:"nullableObject" json:"nullableObject"`
}

#/components/schemas/NullableRequired

func (*NullableRequired) ApplyDefaults

func (s *NullableRequired) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type NullableRequiredNullableObject

type NullableRequiredNullableObject struct {
	Name *string `form:"name,omitempty" json:"name,omitempty"`
}

#/components/schemas/NullableRequired/properties/nullableObject

func (*NullableRequiredNullableObject) ApplyDefaults

func (s *NullableRequiredNullableObject) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type ObjectMap

type ObjectMap = map[string]any

#/components/schemas/ObjectMap

type ObjectWithAnyOfProperty

type ObjectWithAnyOfProperty struct {
	Value *ObjectWithAnyOfPropertyValue `form:"value,omitempty" json:"value,omitempty"`
}

#/components/schemas/ObjectWithAnyOfProperty

func (*ObjectWithAnyOfProperty) ApplyDefaults

func (s *ObjectWithAnyOfProperty) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type ObjectWithAnyOfPropertyValue

type ObjectWithAnyOfPropertyValue struct {
	String0 *string
	Int1    *int
	Bool2   *bool
}

#/components/schemas/ObjectWithAnyOfProperty/properties/value

func (*ObjectWithAnyOfPropertyValue) ApplyDefaults

func (u *ObjectWithAnyOfPropertyValue) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (ObjectWithAnyOfPropertyValue) MarshalJSON

func (u ObjectWithAnyOfPropertyValue) MarshalJSON() ([]byte, error)

func (*ObjectWithAnyOfPropertyValue) UnmarshalJSON

func (u *ObjectWithAnyOfPropertyValue) UnmarshalJSON(data []byte) error

type ObjectWithEnum

type ObjectWithEnum struct {
	Status   *string `form:"status,omitempty" json:"status,omitempty"`
	Priority *int    `form:"priority,omitempty" json:"priority,omitempty"`
}

#/components/schemas/ObjectWithEnum

func (*ObjectWithEnum) ApplyDefaults

func (s *ObjectWithEnum) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type ObjectWithEnumPriority

type ObjectWithEnumPriority int

#/components/schemas/ObjectWithEnum/properties/priority

const (
	ObjectWithEnumPriorityN1 ObjectWithEnumPriority = 1
	ObjectWithEnumPriorityN2 ObjectWithEnumPriority = 2
	ObjectWithEnumPriorityN3 ObjectWithEnumPriority = 3
)

type ObjectWithEnumStatus

type ObjectWithEnumStatus string

#/components/schemas/ObjectWithEnum/properties/status

const (
	Pending   ObjectWithEnumStatus = "pending"
	Active    ObjectWithEnumStatus = "active"
	Completed ObjectWithEnumStatus = "completed"
)

type ObjectWithOneOfProperty

type ObjectWithOneOfProperty struct {
	ID      *int                            `form:"id,omitempty" json:"id,omitempty"`
	Variant *ObjectWithOneOfPropertyVariant `form:"variant,omitempty" json:"variant,omitempty"`
}

#/components/schemas/ObjectWithOneOfProperty

func (*ObjectWithOneOfProperty) ApplyDefaults

func (s *ObjectWithOneOfProperty) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type ObjectWithOneOfPropertyVariant

type ObjectWithOneOfPropertyVariant struct {
	Cat *Cat
	Dog *Dog
}

#/components/schemas/ObjectWithOneOfProperty/properties/variant

func (*ObjectWithOneOfPropertyVariant) ApplyDefaults

func (u *ObjectWithOneOfPropertyVariant) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (ObjectWithOneOfPropertyVariant) MarshalJSON

func (u ObjectWithOneOfPropertyVariant) MarshalJSON() ([]byte, error)

func (*ObjectWithOneOfPropertyVariant) UnmarshalJSON

func (u *ObjectWithOneOfPropertyVariant) UnmarshalJSON(data []byte) error

type OneOfInline

type OneOfInline struct {
	OneOfInlineOneOf0 *OneOfInlineOneOf0
	OneOfInlineOneOf1 *OneOfInlineOneOf1
}

#/components/schemas/OneOfInline

func (*OneOfInline) ApplyDefaults

func (u *OneOfInline) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (OneOfInline) MarshalJSON

func (u OneOfInline) MarshalJSON() ([]byte, error)

func (*OneOfInline) UnmarshalJSON

func (u *OneOfInline) UnmarshalJSON(data []byte) error

type OneOfInlineOneOf0

type OneOfInlineOneOf0 struct {
	OptionA *string `form:"optionA,omitempty" json:"optionA,omitempty"`
}

#/components/schemas/OneOfInline/oneOf/0

func (*OneOfInlineOneOf0) ApplyDefaults

func (s *OneOfInlineOneOf0) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type OneOfInlineOneOf1

type OneOfInlineOneOf1 struct {
	OptionB *int `form:"optionB,omitempty" json:"optionB,omitempty"`
}

#/components/schemas/OneOfInline/oneOf/1

func (*OneOfInlineOneOf1) ApplyDefaults

func (s *OneOfInlineOneOf1) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type OneOfPrimitives

type OneOfPrimitives struct {
	String0  *string
	Float321 *float32
	Bool2    *bool
}

#/components/schemas/OneOfPrimitives

func (*OneOfPrimitives) ApplyDefaults

func (u *OneOfPrimitives) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (OneOfPrimitives) MarshalJSON

func (u OneOfPrimitives) MarshalJSON() ([]byte, error)

func (*OneOfPrimitives) UnmarshalJSON

func (u *OneOfPrimitives) UnmarshalJSON(data []byte) error

type OneOfSimple

type OneOfSimple struct {
	SimpleObject   *SimpleObject
	BaseProperties *BaseProperties
}

#/components/schemas/OneOfSimple

func (*OneOfSimple) ApplyDefaults

func (u *OneOfSimple) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (OneOfSimple) MarshalJSON

func (u OneOfSimple) MarshalJSON() ([]byte, error)

func (*OneOfSimple) UnmarshalJSON

func (u *OneOfSimple) UnmarshalJSON(data []byte) error

type OneOfWithAllOf

type OneOfWithAllOf struct {
	OneOfWithAllOfOneOf0 *OneOfWithAllOfOneOf0
	OneOfWithAllOfOneOf1 *OneOfWithAllOfOneOf1
}

#/components/schemas/OneOfWithAllOf

func (*OneOfWithAllOf) ApplyDefaults

func (u *OneOfWithAllOf) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (OneOfWithAllOf) MarshalJSON

func (u OneOfWithAllOf) MarshalJSON() ([]byte, error)

func (*OneOfWithAllOf) UnmarshalJSON

func (u *OneOfWithAllOf) UnmarshalJSON(data []byte) error

type OneOfWithAllOfOneOf0

type OneOfWithAllOfOneOf0 struct {
	ID        *int       `form:"id,omitempty" json:"id,omitempty"`
	CreatedAt *time.Time `form:"createdAt,omitempty" json:"createdAt,omitempty"`
	Variant   *string    `form:"variant,omitempty" json:"variant,omitempty"`
}

#/components/schemas/OneOfWithAllOf/oneOf/0

func (*OneOfWithAllOfOneOf0) ApplyDefaults

func (s *OneOfWithAllOfOneOf0) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type OneOfWithAllOfOneOf1

type OneOfWithAllOfOneOf1 struct {
	ID        *int       `form:"id,omitempty" json:"id,omitempty"`
	CreatedAt *time.Time `form:"createdAt,omitempty" json:"createdAt,omitempty"`
	Variant   *string    `form:"variant,omitempty" json:"variant,omitempty"`
}

#/components/schemas/OneOfWithAllOf/oneOf/1

func (*OneOfWithAllOfOneOf1) ApplyDefaults

func (s *OneOfWithAllOfOneOf1) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type OneOfWithDiscriminator

type OneOfWithDiscriminator struct {
	Cat *Cat
	Dog *Dog
}

#/components/schemas/OneOfWithDiscriminator

func (*OneOfWithDiscriminator) ApplyDefaults

func (u *OneOfWithDiscriminator) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (OneOfWithDiscriminator) MarshalJSON

func (u OneOfWithDiscriminator) MarshalJSON() ([]byte, error)

func (*OneOfWithDiscriminator) UnmarshalJSON

func (u *OneOfWithDiscriminator) UnmarshalJSON(data []byte) error

type OneOfWithDiscriminatorMapping

type OneOfWithDiscriminatorMapping struct {
	Cat *Cat
	Dog *Dog
}

#/components/schemas/OneOfWithDiscriminatorMapping

func (*OneOfWithDiscriminatorMapping) ApplyDefaults

func (u *OneOfWithDiscriminatorMapping) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (OneOfWithDiscriminatorMapping) MarshalJSON

func (u OneOfWithDiscriminatorMapping) MarshalJSON() ([]byte, error)

func (*OneOfWithDiscriminatorMapping) UnmarshalJSON

func (u *OneOfWithDiscriminatorMapping) UnmarshalJSON(data []byte) error

type PrefixItems31

type PrefixItems31 = []string

#/components/schemas/PrefixItems31

type ReadWriteOnly

type ReadWriteOnly struct {
	ID       int     `form:"id" json:"id"`
	Password string  `form:"password" json:"password"`
	Name     *string `form:"name,omitempty" json:"name,omitempty"`
}

#/components/schemas/ReadWriteOnly

func (*ReadWriteOnly) ApplyDefaults

func (s *ReadWriteOnly) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type RecursiveOneOf

type RecursiveOneOf struct {
	String0              *string
	RecursiveOneOfOneOf1 *RecursiveOneOfOneOf1
}

#/components/schemas/RecursiveOneOf

func (*RecursiveOneOf) ApplyDefaults

func (u *RecursiveOneOf) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

func (RecursiveOneOf) MarshalJSON

func (u RecursiveOneOf) MarshalJSON() ([]byte, error)

func (*RecursiveOneOf) UnmarshalJSON

func (u *RecursiveOneOf) UnmarshalJSON(data []byte) error

type RecursiveOneOfOneOf1

type RecursiveOneOfOneOf1 struct {
	Nested *RecursiveOneOf `form:"nested,omitempty" json:"nested,omitempty"`
}

#/components/schemas/RecursiveOneOf/oneOf/1

func (*RecursiveOneOfOneOf1) ApplyDefaults

func (s *RecursiveOneOfOneOf1) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type SimpleObject

type SimpleObject struct {
	ID   int     `form:"id" json:"id"`
	Name *string `form:"name,omitempty" json:"name,omitempty"`
}

#/components/schemas/SimpleObject

func (*SimpleObject) ApplyDefaults

func (s *SimpleObject) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type StringEnum

type StringEnum string

#/components/schemas/StringEnum

const (
	Value1 StringEnum = "value1"
	Value2 StringEnum = "value2"
	Value3 StringEnum = "value3"
)

type StringMap

type StringMap = map[string]string

#/components/schemas/StringMap

type TreeNode

type TreeNode struct {
	Value    *string    `form:"value,omitempty" json:"value,omitempty"`
	Children []TreeNode `form:"children,omitempty" json:"children,omitempty"`
}

#/components/schemas/TreeNode

func (*TreeNode) ApplyDefaults

func (s *TreeNode) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type TreeNodeChildren

type TreeNodeChildren = []TreeNode

#/components/schemas/TreeNode/properties/children

type TypeArray31

type TypeArray31 struct {
	Name *string `form:"name,omitempty" json:"name,omitempty"`
}

#/components/schemas/TypeArray31

func (*TypeArray31) ApplyDefaults

func (s *TypeArray31) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type UUID

type UUID = uuid.UUID

type WithConst

type WithConst struct {
	Version *string `form:"version,omitempty" json:"version,omitempty"`
	Type    *string `form:"type,omitempty" json:"type,omitempty"`
}

#/components/schemas/WithConst

func (*WithConst) ApplyDefaults

func (s *WithConst) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type WithConstraints

type WithConstraints struct {
	BoundedInt          *int     `form:"boundedInt,omitempty" json:"boundedInt,omitempty"`
	ExclusiveBoundedInt *int     `form:"exclusiveBoundedInt,omitempty" json:"exclusiveBoundedInt,omitempty"`
	MultipleOf          *int     `form:"multipleOf,omitempty" json:"multipleOf,omitempty"`
	BoundedString       *string  `form:"boundedString,omitempty" json:"boundedString,omitempty"`
	PatternString       *string  `form:"patternString,omitempty" json:"patternString,omitempty"`
	BoundedArray        []string `form:"boundedArray,omitempty" json:"boundedArray,omitempty"`
	UniqueArray         []string `form:"uniqueArray,omitempty" json:"uniqueArray,omitempty"`
}

#/components/schemas/WithConstraints

func (*WithConstraints) ApplyDefaults

func (s *WithConstraints) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type WithDefaults

type WithDefaults struct {
	StringWithDefault *string  `form:"stringWithDefault,omitempty" json:"stringWithDefault,omitempty"`
	IntWithDefault    *int     `form:"intWithDefault,omitempty" json:"intWithDefault,omitempty"`
	BoolWithDefault   *bool    `form:"boolWithDefault,omitempty" json:"boolWithDefault,omitempty"`
	ArrayWithDefault  []string `form:"arrayWithDefault,omitempty" json:"arrayWithDefault,omitempty"`
}

#/components/schemas/WithDefaults

func (*WithDefaults) ApplyDefaults

func (s *WithDefaults) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

Jump to

Keyboard shortcuts

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