From 2bec830a421d2ddb8f49b0f761ae4aa5402969fd Mon Sep 17 00:00:00 2001 From: Nathan Fischer Date: Mon, 22 Feb 2021 16:26:48 -0800 Subject: [PATCH] Combine findPetsBy(Status/Tag) into general GET /pets --- src/main/resources/openapi.yaml | 128 ++++++++++++-------------------- 1 file changed, 49 insertions(+), 79 deletions(-) diff --git a/src/main/resources/openapi.yaml b/src/main/resources/openapi.yaml index 04a65349..aa402e5b 100644 --- a/src/main/resources/openapi.yaml +++ b/src/main/resources/openapi.yaml @@ -34,6 +34,55 @@ tags: url: 'http://swagger.io' paths: /pet: + get: + tags: + - pet + summary: Finds Pets by status or tag + description: Multiple status or tag values can be provided with comma separated strings + operationId: findPets + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: false + style: form + explode: false + schema: + type: string + default: available + enum: + - available + - pending + - sold + - name: tags + in: query + description: Tags to filter by + required: false + explode: true + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status or tag value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' post: tags: - pet @@ -108,85 +157,6 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Pet' - /pet/findByStatus: - get: - tags: - - pet - summary: Finds Pets by status - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - name: status - in: query - description: Status values that need to be considered for filter - required: false - explode: true - schema: - type: string - enum: - - available - - pending - - sold - default: available - responses: - '200': - description: successful operation - content: - application/xml: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - '400': - description: Invalid status value - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - /pet/findByTags: - get: - tags: - - pet - summary: Finds Pets by tags - description: >- - Multiple tags can be provided with comma separated strings. Use tag1, - tag2, tag3 for testing. - operationId: findPetsByTags - parameters: - - name: tags - in: query - description: Tags to filter by - required: false - explode: true - schema: - type: array - items: - type: string - responses: - '200': - description: successful operation - content: - application/xml: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - '400': - description: Invalid tag value - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' '/pet/{petId}': get: tags: