Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOpenAPISpecJSON ¶
GetOpenAPISpecJSON returns the raw OpenAPI spec as JSON bytes.
Types ¶
type Person ¶
type Person struct {
FirstName string `json:"FirstName" form:"FirstName"`
LastName string `json:"LastName" form:"LastName"`
GovernmentIDNumber *int64 `json:"GovernmentIDNumber,omitempty" form:"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 `json:"FirstName,omitempty" form:"FirstName,omitempty"`
LastName *string `json:"LastName,omitempty" form:"LastName,omitempty"`
GovernmentIDNumber *int64 `json:"GovernmentIDNumber,omitempty" form:"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 `json:"FirstName,omitempty" form:"FirstName,omitempty"`
LastName *string `json:"LastName,omitempty" form:"LastName,omitempty"`
GovernmentIDNumber *int64 `json:"GovernmentIDNumber,omitempty" form:"GovernmentIDNumber,omitempty"`
ID int64 `json:"ID" form:"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.