output

package
v0.0.0-...-da2a1ef Latest Latest
Warning

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

Go to latest
Published: Feb 15, 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        `json:"known,omitempty" form:"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              `json:"id,omitempty" form:"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 `json:"first,omitempty" form:"first,omitempty"`
	Second *int    `json:"second,omitempty" form:"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        `json:"id" form:"id"`
	CreatedAt *time.Time `json:"createdAt,omitempty" form:"createdAt,omitempty"`
	Name      *string    `json:"name,omitempty" form:"name,omitempty"`
	Merged    *bool      `json:"merged,omitempty" form:"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                  `json:"id,omitempty" form:"id,omitempty"`
	CreatedAt            *time.Time            `json:"createdAt,omitempty" form:"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       `json:"intField,omitempty" form:"intField,omitempty"`
	Int32Field    *int32     `json:"int32Field,omitempty" form:"int32Field,omitempty"`
	Int64Field    *int64     `json:"int64Field,omitempty" form:"int64Field,omitempty"`
	FloatField    *float32   `json:"floatField,omitempty" form:"floatField,omitempty"`
	DoubleField   *float64   `json:"doubleField,omitempty" form:"doubleField,omitempty"`
	NumberField   *float32   `json:"numberField,omitempty" form:"numberField,omitempty"`
	StringField   *string    `json:"stringField,omitempty" form:"stringField,omitempty"`
	BoolField     *bool      `json:"boolField,omitempty" form:"boolField,omitempty"`
	DateField     *Date      `json:"dateField,omitempty" form:"dateField,omitempty"`
	DateTimeField *time.Time `json:"dateTimeField,omitempty" form:"dateTimeField,omitempty"`
	UUIDField     *UUID      `json:"uuidField,omitempty" form:"uuidField,omitempty"`
	EmailField    *Email     `json:"emailField,omitempty" form:"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       `json:"intField" form:"intField"`
	Int32Field    int32     `json:"int32Field" form:"int32Field"`
	Int64Field    int64     `json:"int64Field" form:"int64Field"`
	FloatField    float32   `json:"floatField" form:"floatField"`
	DoubleField   float64   `json:"doubleField" form:"doubleField"`
	NumberField   float32   `json:"numberField" form:"numberField"`
	StringField   string    `json:"stringField" form:"stringField"`
	BoolField     bool      `json:"boolField" form:"boolField"`
	DateField     Date      `json:"dateField" form:"dateField"`
	DateTimeField time.Time `json:"dateTimeField" form:"dateTimeField"`
	UUIDField     UUID      `json:"uuidField" form:"uuidField"`
	EmailField    Email     `json:"emailField" form:"emailField"`
	URIField      string    `json:"uriField" form:"uriField"`
	HostnameField string    `json:"hostnameField" form:"hostnameField"`
	Ipv4Field     string    `json:"ipv4Field" form:"ipv4Field"`
	Ipv6Field     string    `json:"ipv6Field" form:"ipv6Field"`
	ByteField     []byte    `json:"byteField" form:"byteField"`
	BinaryField   File      `json:"binaryField" form:"binaryField"`
	PasswordField string    `json:"passwordField" form:"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 `json:"inline,omitempty" form:"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                          `json:"stringArray,omitempty" form:"stringArray,omitempty"`
	IntArray             []int                             `json:"intArray,omitempty" form:"intArray,omitempty"`
	ObjectArray          []SimpleObject                    `json:"objectArray,omitempty" form:"objectArray,omitempty"`
	InlineObjectArray    []ArrayTypesInlineObjectArrayItem `json:"inlineObjectArray,omitempty" form:"inlineObjectArray,omitempty"`
	NestedArray          [][]string                        `json:"nestedArray,omitempty" form:"nestedArray,omitempty"`
	NullableArray        []string                          `json:"nullableArray,omitempty" form:"nullableArray,omitempty"`
	ArrayWithConstraints []string                          `json:"arrayWithConstraints,omitempty" form:"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    `json:"id,omitempty" form:"id,omitempty"`
	Name *string `json:"name,omitempty" form:"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       `json:"id,omitempty" form:"id,omitempty"`
	CreatedAt *time.Time `json:"createdAt,omitempty" form:"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   `json:"petType" form:"petType"`
	Meow          string   `json:"meow" form:"meow"`
	WhiskerLength *float32 `json:"whiskerLength,omitempty" form:"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          `json:"metadata,omitempty" form:"metadata,omitempty"`
	Items    []ComplexNestedItemItem `json:"items,omitempty" form:"items,omitempty"`
	Config   *ComplexNestedConfig    `json:"config,omitempty" form:"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 `json:"mode,omitempty" form:"mode,omitempty"`
	Value *string `json:"value,omitempty" form:"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           `json:"mode,omitempty" form:"mode,omitempty"`
	Options map[string]string `json:"options,omitempty" form:"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       `json:"id,omitempty" form:"id,omitempty"`
	CreatedAt *time.Time `json:"createdAt,omitempty" form:"createdAt,omitempty"`
	Tags      []string   `json:"tags,omitempty" form:"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       `json:"id,omitempty" form:"id,omitempty"`
	CreatedAt   *time.Time `json:"createdAt,omitempty" form:"createdAt,omitempty"`
	Name        string     `json:"name" form:"name"`
	Description *string    `json:"description,omitempty" form:"description,omitempty"`
	Extra       *string    `json:"extra,omitempty" form:"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   `json:"petType" form:"petType"`
	Bark       string   `json:"bark" form:"bark"`
	TailLength *float32 `json:"tailLength,omitempty" form:"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       `json:"id,omitempty" form:"id,omitempty"`
	CreatedAt   *time.Time `json:"createdAt,omitempty" form:"createdAt,omitempty"`
	Name        string     `json:"name" form:"name"`
	Description *string    `json:"description,omitempty" form:"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    `json:"id" form:"id"`
	Name string `json:"name" form:"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 `json:"inlineStatus,omitempty" form:"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            `json:"value,omitempty" form:"value,omitempty"`
	Next  *LinkedListNode `json:"next,omitempty" form:"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 `json:"outer,omitempty" form:"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 `json:"inner,omitempty" form:"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 `json:"value,omitempty" form:"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] `json:"nullableString,omitempty" form:"nullableString,omitempty"`
	NullableInt    Nullable[int]    `json:"nullableInt,omitempty" form:"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] `json:"nullableObject" form:"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] `json:"nullableObject" form:"nullableObject"`
	NullableObjectOptional Nullable[SimpleObject] `json:"nullableObjectOptional,omitempty" form:"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]                         `json:"nullableString" form:"nullableString"`
	NullableInt    Nullable[int]                            `json:"nullableInt" form:"nullableInt"`
	NullableObject Nullable[NullableRequiredNullableObject] `json:"nullableObject" form:"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 `json:"name,omitempty" form:"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 `json:"value,omitempty" form:"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 `json:"status,omitempty" form:"status,omitempty"`
	Priority *int    `json:"priority,omitempty" form:"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                            `json:"id,omitempty" form:"id,omitempty"`
	Variant *ObjectWithOneOfPropertyVariant `json:"variant,omitempty" form:"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 `json:"optionA,omitempty" form:"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 `json:"optionB,omitempty" form:"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       `json:"id,omitempty" form:"id,omitempty"`
	CreatedAt *time.Time `json:"createdAt,omitempty" form:"createdAt,omitempty"`
	Variant   *string    `json:"variant,omitempty" form:"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       `json:"id,omitempty" form:"id,omitempty"`
	CreatedAt *time.Time `json:"createdAt,omitempty" form:"createdAt,omitempty"`
	Variant   *string    `json:"variant,omitempty" form:"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     `json:"id" form:"id"`
	Password string  `json:"password" form:"password"`
	Name     *string `json:"name,omitempty" form:"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 `json:"nested,omitempty" form:"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     `json:"id" form:"id"`
	Name *string `json:"name,omitempty" form:"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    `json:"value,omitempty" form:"value,omitempty"`
	Children []TreeNode `json:"children,omitempty" form:"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 `json:"name,omitempty" form:"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 `json:"version,omitempty" form:"version,omitempty"`
	Type    *string `json:"type,omitempty" form:"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     `json:"boundedInt,omitempty" form:"boundedInt,omitempty"`
	ExclusiveBoundedInt *int     `json:"exclusiveBoundedInt,omitempty" form:"exclusiveBoundedInt,omitempty"`
	MultipleOf          *int     `json:"multipleOf,omitempty" form:"multipleOf,omitempty"`
	BoundedString       *string  `json:"boundedString,omitempty" form:"boundedString,omitempty"`
	PatternString       *string  `json:"patternString,omitempty" form:"patternString,omitempty"`
	BoundedArray        []string `json:"boundedArray,omitempty" form:"boundedArray,omitempty"`
	UniqueArray         []string `json:"uniqueArray,omitempty" form:"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  `json:"stringWithDefault,omitempty" form:"stringWithDefault,omitempty"`
	IntWithDefault    *int     `json:"intWithDefault,omitempty" form:"intWithDefault,omitempty"`
	BoolWithDefault   *bool    `json:"boolWithDefault,omitempty" form:"boolWithDefault,omitempty"`
	ArrayWithDefault  []string `json:"arrayWithDefault,omitempty" form:"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