Skip to content

Instantly share code, notes, and snippets.

@vedashree29296
Created January 25, 2021 10:57
Show Gist options
  • Save vedashree29296/cba1c56a8823df94722e6f72ad545560 to your computer and use it in GitHub Desktop.
Save vedashree29296/cba1c56a8823df94722e6f72ad545560 to your computer and use it in GitHub Desktop.
paths:
"/pet":
get:
parameters:
- in: query # defines the query parameter that should be sent which is the category id
name: categoryId
schema:
type: integer
example: 1
required: true
description: category id to fetch pets for
tags:
- Pet
summary: Get all pets based on category id
responses:
200: # define the response based on a success condition
description: Success
content:
application/json: # this shows that response is a JSON object
schema:
type: array # returns an array
items:
$ref: "#/components/schemas/Pet" # refers to the pet schema defined earlier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment