Help us shape the future of Go! Take the 2026 Go Developer Survey

output

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOpenAPISpecJSON

func GetOpenAPISpecJSON() ([]byte, error)

GetOpenAPISpecJSON returns the raw OpenAPI spec as JSON bytes.

Types

type Person

type Person struct {
	FirstName          string `form:"FirstName" json:"FirstName"`
	LastName           string `form:"LastName" json:"LastName"`
	GovernmentIDNumber *int64 `form:"GovernmentIDNumber,omitempty" json:"GovernmentIDNumber,omitempty"`
}

#/components/schemas/Person This is a person, with mandatory first and last name, but optional ID number. This would be returned by a `Get` style API. We merge the person properties with another Schema which only provides required fields.

func (*Person) ApplyDefaults

func (s *Person) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type PersonProperties

type PersonProperties struct {
	FirstName          *string `form:"FirstName,omitempty" json:"FirstName,omitempty"`
	LastName           *string `form:"LastName,omitempty" json:"LastName,omitempty"`
	GovernmentIDNumber *int64  `form:"GovernmentIDNumber,omitempty" json:"GovernmentIDNumber,omitempty"`
}

#/components/schemas/PersonProperties These are fields that specify a person. They are all optional, and would be used by an `Edit` style API endpoint, where each is optional.

func (*PersonProperties) ApplyDefaults

func (s *PersonProperties) ApplyDefaults()

ApplyDefaults sets default values for fields that are nil.

type PersonWithID

type PersonWithID struct {
	FirstName          *string `form:"FirstName,omitempty" json:"FirstName,omitempty"`
	LastName           *string `form:"LastName,omitempty" json:"LastName,omitempty"`
	GovernmentIDNumber *int64  `form:"GovernmentIDNumber,omitempty" json:"GovernmentIDNumber,omitempty"`
	ID                 int64   `form:"ID" json:"ID"`
}

#/components/schemas/PersonWithID This is a person record as returned from a Create endpoint. It contains all the fields of a Person, with an additional resource UUID.

func (*PersonWithID) ApplyDefaults

func (s *PersonWithID) 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