mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 02:32:45 +00:00
Regenerate (#17389)
This commit is contained in:
@@ -82,6 +82,24 @@ paths:
|
||||
description: Multiple status values can be provided with comma separated strings
|
||||
operationId: findPetsByStatus
|
||||
parameters:
|
||||
- name: inlineEnumPath
|
||||
in: path
|
||||
description: Entity type
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- "OPTION_1"
|
||||
- "OPTION_2"
|
||||
- "OPTION_3"
|
||||
- name: inlineEnum
|
||||
in: query
|
||||
description: Entity type
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- "OPTION_1"
|
||||
- "OPTION_2"
|
||||
- "OPTION_3"
|
||||
- name: status
|
||||
in: query
|
||||
description: Status values that need to be considered for filter
|
||||
|
||||
@@ -81,6 +81,30 @@ paths:
|
||||
description: Multiple status values can be provided with comma separated strings
|
||||
operationId: findPetsByStatus
|
||||
parameters:
|
||||
- description: Entity type
|
||||
explode: false
|
||||
in: path
|
||||
name: inlineEnumPath
|
||||
required: false
|
||||
schema:
|
||||
enum:
|
||||
- OPTION_1
|
||||
- OPTION_2
|
||||
- OPTION_3
|
||||
type: string
|
||||
style: simple
|
||||
- description: Entity type
|
||||
explode: true
|
||||
in: query
|
||||
name: inlineEnum
|
||||
required: false
|
||||
schema:
|
||||
enum:
|
||||
- OPTION_1
|
||||
- OPTION_2
|
||||
- OPTION_3
|
||||
type: string
|
||||
style: form
|
||||
- deprecated: true
|
||||
description: Status values that need to be considered for filter
|
||||
explode: false
|
||||
|
||||
@@ -69,7 +69,7 @@ type PetAPIServicer interface {
|
||||
AddPet(context.Context, Pet) (ImplResponse, error)
|
||||
DeletePet(context.Context, int64, string) (ImplResponse, error)
|
||||
FilterPetsByCategory(context.Context, Gender, Species, []Species) (ImplResponse, error)
|
||||
FindPetsByStatus(context.Context, []string) (ImplResponse, error)
|
||||
FindPetsByStatus(context.Context, []string, string, string) (ImplResponse, error)
|
||||
// Deprecated
|
||||
FindPetsByTags(context.Context, []string, time.Time, time.Time) (ImplResponse, error)
|
||||
GetPetById(context.Context, int64) (ImplResponse, error)
|
||||
|
||||
@@ -210,12 +210,22 @@ func (c *PetAPIController) FilterPetsByCategory(w http.ResponseWriter, r *http.R
|
||||
|
||||
// FindPetsByStatus - Finds Pets by status
|
||||
func (c *PetAPIController) FindPetsByStatus(w http.ResponseWriter, r *http.Request) {
|
||||
params := mux.Vars(r)
|
||||
query := r.URL.Query()
|
||||
var statusParam []string
|
||||
if query.Has("status") {
|
||||
statusParam = strings.Split(query.Get("status"), ",")
|
||||
}
|
||||
result, err := c.service.FindPetsByStatus(r.Context(), statusParam)
|
||||
inlineEnumPathParam := params["inlineEnumPath"]
|
||||
if inlineEnumPathParam == "" {
|
||||
c.errorHandler(w, r, &RequiredError{"inlineEnumPath"}, nil)
|
||||
return
|
||||
}
|
||||
var inlineEnumParam string
|
||||
if query.Has("inlineEnum") {
|
||||
inlineEnumParam = query.Get("inlineEnum")
|
||||
}
|
||||
result, err := c.service.FindPetsByStatus(r.Context(), statusParam, inlineEnumPathParam, inlineEnumParam)
|
||||
// If an error occurred, encode the error with the status code
|
||||
if err != nil {
|
||||
c.errorHandler(w, r, err, &result)
|
||||
|
||||
@@ -68,7 +68,7 @@ func (s *PetAPIService) FilterPetsByCategory(ctx context.Context, gender Gender,
|
||||
}
|
||||
|
||||
// FindPetsByStatus - Finds Pets by status
|
||||
func (s *PetAPIService) FindPetsByStatus(ctx context.Context, status []string) (ImplResponse, error) {
|
||||
func (s *PetAPIService) FindPetsByStatus(ctx context.Context, status []string, inlineEnumPath string, inlineEnum string) (ImplResponse, error) {
|
||||
// TODO - update FindPetsByStatus 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.
|
||||
|
||||
|
||||
@@ -81,6 +81,30 @@ paths:
|
||||
description: Multiple status values can be provided with comma separated strings
|
||||
operationId: findPetsByStatus
|
||||
parameters:
|
||||
- description: Entity type
|
||||
explode: false
|
||||
in: path
|
||||
name: inlineEnumPath
|
||||
required: false
|
||||
schema:
|
||||
enum:
|
||||
- OPTION_1
|
||||
- OPTION_2
|
||||
- OPTION_3
|
||||
type: string
|
||||
style: simple
|
||||
- description: Entity type
|
||||
explode: true
|
||||
in: query
|
||||
name: inlineEnum
|
||||
required: false
|
||||
schema:
|
||||
enum:
|
||||
- OPTION_1
|
||||
- OPTION_2
|
||||
- OPTION_3
|
||||
type: string
|
||||
style: form
|
||||
- deprecated: true
|
||||
description: Status values that need to be considered for filter
|
||||
explode: false
|
||||
|
||||
@@ -69,7 +69,7 @@ type PetAPIServicer interface {
|
||||
AddPet(context.Context, Pet) (ImplResponse, error)
|
||||
DeletePet(context.Context, int64, string) (ImplResponse, error)
|
||||
FilterPetsByCategory(context.Context, Gender, Species, []Species) (ImplResponse, error)
|
||||
FindPetsByStatus(context.Context, []string) (ImplResponse, error)
|
||||
FindPetsByStatus(context.Context, []string, string, string) (ImplResponse, error)
|
||||
// Deprecated
|
||||
FindPetsByTags(context.Context, []string, time.Time, time.Time) (ImplResponse, error)
|
||||
GetPetById(context.Context, int64) (ImplResponse, error)
|
||||
|
||||
@@ -213,7 +213,16 @@ func (c *PetAPIController) FindPetsByStatus(w http.ResponseWriter, r *http.Reque
|
||||
if query.Has("status") {
|
||||
statusParam = strings.Split(query.Get("status"), ",")
|
||||
}
|
||||
result, err := c.service.FindPetsByStatus(r.Context(), statusParam)
|
||||
inlineEnumPathParam := chi.URLParam(r, "inlineEnumPath")
|
||||
if inlineEnumPathParam == "" {
|
||||
c.errorHandler(w, r, &RequiredError{"inlineEnumPath"}, nil)
|
||||
return
|
||||
}
|
||||
var inlineEnumParam string
|
||||
if query.Has("inlineEnum") {
|
||||
inlineEnumParam = query.Get("inlineEnum")
|
||||
}
|
||||
result, err := c.service.FindPetsByStatus(r.Context(), statusParam, inlineEnumPathParam, inlineEnumParam)
|
||||
// If an error occurred, encode the error with the status code
|
||||
if err != nil {
|
||||
c.errorHandler(w, r, err, &result)
|
||||
|
||||
@@ -68,7 +68,7 @@ func (s *PetAPIService) FilterPetsByCategory(ctx context.Context, gender Gender,
|
||||
}
|
||||
|
||||
// FindPetsByStatus - Finds Pets by status
|
||||
func (s *PetAPIService) FindPetsByStatus(ctx context.Context, status []string) (ImplResponse, error) {
|
||||
func (s *PetAPIService) FindPetsByStatus(ctx context.Context, status []string, inlineEnumPath string, inlineEnum string) (ImplResponse, error) {
|
||||
// TODO - update FindPetsByStatus 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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user