mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-07 11:46:09 +00:00
[go] More idiomatic godoc comments (#10044)
* [go] More idiomatic godoc comments * [go] Mark deprecated fields and functions * [go] Minor mustache readability/consistency fixes * [go] Mark deprecated operation parameters * [go] Deprecate a petstore component property for testing * [go] Apply deprecated godoc in Go servers also
This commit is contained in:
@@ -24,6 +24,7 @@ type PetApiRouter interface {
|
||||
AddPet(http.ResponseWriter, *http.Request)
|
||||
DeletePet(http.ResponseWriter, *http.Request)
|
||||
FindPetsByStatus(http.ResponseWriter, *http.Request)
|
||||
// Deprecated
|
||||
FindPetsByTags(http.ResponseWriter, *http.Request)
|
||||
GetPetById(http.ResponseWriter, *http.Request)
|
||||
UpdatePet(http.ResponseWriter, *http.Request)
|
||||
@@ -62,6 +63,7 @@ type PetApiServicer interface {
|
||||
AddPet(context.Context, Pet) (ImplResponse, error)
|
||||
DeletePet(context.Context, int64, string) (ImplResponse, error)
|
||||
FindPetsByStatus(context.Context, []string) (ImplResponse, error)
|
||||
// Deprecated
|
||||
FindPetsByTags(context.Context, []string) (ImplResponse, error)
|
||||
GetPetById(context.Context, int64) (ImplResponse, error)
|
||||
UpdatePet(context.Context, Pet) (ImplResponse, error)
|
||||
|
||||
@@ -156,6 +156,7 @@ func (c *PetApiController) FindPetsByStatus(w http.ResponseWriter, r *http.Reque
|
||||
}
|
||||
|
||||
// FindPetsByTags - Finds Pets by tags
|
||||
// Deprecated
|
||||
func (c *PetApiController) FindPetsByTags(w http.ResponseWriter, r *http.Request) {
|
||||
query := r.URL.Query()
|
||||
tags := strings.Split(query.Get("tags"), ",")
|
||||
|
||||
@@ -67,6 +67,7 @@ func (s *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
|
||||
}
|
||||
|
||||
// FindPetsByTags - Finds Pets by tags
|
||||
// Deprecated
|
||||
func (s *PetApiService) FindPetsByTags(ctx context.Context, tags []string) (ImplResponse, error) {
|
||||
// TODO - update FindPetsByTags with the required logic for this service method.
|
||||
// Add api_pet_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
|
||||
|
||||
@@ -23,5 +23,6 @@ type Pet struct {
|
||||
Tags []Tag `json:"tags,omitempty"`
|
||||
|
||||
// pet status in the store
|
||||
// Deprecated
|
||||
Status string `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user