/* * OpenAPI Petstore * * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * API version: 1.0.0 * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ package petstoreserver // Pet - A pet for sale in the pet store type Pet struct { Id int64 `json:"id,omitempty"` Category *Category `json:"category,omitempty"` Name string `json:"name"` PhotoUrls *[]string `json:"photoUrls"` Tags *[]Tag `json:"tags,omitempty"` // pet status in the store Status string `json:"status,omitempty"` } // AssertPetRequired checks if the required fields are not zero-ed func AssertPetRequired(obj Pet) error { elements := map[string]interface{}{ "name": obj.Name, "photoUrls": obj.PhotoUrls, } for name, el := range elements { if isZero := IsZeroValue(el); isZero { return &RequiredError{Field: name} } } if obj.Category != nil { if err := AssertCategoryRequired(*obj.Category); err != nil { return err } } if obj.Tags != nil { for _, el := range *obj.Tags { if err := AssertTagRequired(el); err != nil { return err } } } return nil } // AssertPetConstraints checks if the values respects the defined constraints func AssertPetConstraints(obj Pet) error { return nil }