Full OpenAPI specification as JSON or YAML string
Default:openapi: 3.0.3
info:
title: Swagger Petstore
description: A sample API that uses a petstore as an example
version: 1.0.0
servers:
- url: https://petstore3.swagger.io/api/v3
paths:
/pet:
post:
tags:
- pet
summary: Add a new pet to the store
operationId: addPet
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
put:
tags:
- pet
summary: Update an existing pet
operationId: updatePet
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
/pet/findByStatus:
get:
tags:
- pet
summary: Finds Pets by status
operationId: findPetsByStatus
parameters:
- name: status
in: query
description: Status values that need to be considered for filter
required: true
schema:
type: array
items:
type: string
enum:
- available
- pending
- sold
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Pet'
/pet/{petId}:
get:
tags:
- pet
summary: Find pet by ID
operationId: getPetById
parameters:
- name: petId
in: path
required: true
schema:
type: integer
format: int64
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
delete:
tags:
- pet
summary: Deletes a pet
operationId: deletePet
parameters:
- name: petId
in: path
required: true
schema:
type: integer
format: int64
responses:
'200':
description: Pet deleted
components:
schemas:
Pet:
type: object
required:
- name
properties:
id:
type: integer
format: int64
nullable: true
name:
type: string
example: doggie
status:
type: string
enum:
- available
- pending
- sold
default: available
Example:openapi: 3.0.3
info:
title: Swagger Petstore
description: A sample API that uses a petstore as an example
version: 1.0.0
servers:
- url: https://petstore3.swagger.io/api/v3
paths:
/pet:
post:
tags:
- pet
summary: Add a new pet to the store
operationId: addPet
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
put:
tags:
- pet
summary: Update an existing pet
operationId: updatePet
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
/pet/findByStatus:
get:
tags:
- pet
summary: Finds Pets by status
operationId: findPetsByStatus
parameters:
- name: status
in: query
description: Status values that need to be considered for filter
required: true
schema:
type: array
items:
type: string
enum:
- available
- pending
- sold
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Pet'
/pet/{petId}:
get:
tags:
- pet
summary: Find pet by ID
operationId: getPetById
parameters:
- name: petId
in: path
required: true
schema:
type: integer
format: int64
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
delete:
tags:
- pet
summary: Deletes a pet
operationId: deletePet
parameters:
- name: petId
in: path
required: true
schema:
type: integer
format: int64
responses:
'200':
description: Pet deleted
components:
schemas:
Pet:
type: object
required:
- name
properties:
id:
type: integer
format: int64
nullable: true
name:
type: string
example: doggie
status:
type: string
enum:
- available
- pending
- sold
default: available