Skip to content

Instantly share code, notes, and snippets.

@gerep
Created November 1, 2016 17:44
Show Gist options
  • Save gerep/70b977c509dd72dda0e02ba7976e807c to your computer and use it in GitHub Desktop.
Save gerep/70b977c509dd72dda0e02ba7976e807c to your computer and use it in GitHub Desktop.
swagger: '2.0'
info:
version: 1.0.9-abcd
title: Swagger Sample API
description: >-
A sample API that uses a petstore as an example to demonstrate features in
the swagger-2.0 specification
host: my.api.com
consumes:
- application/json
produces:
- application/json
paths:
'/pets':
get:
description: Returns pets based on ID
summary: Find pets by ID
operationId: getPetsById
parameters:
- $ref: '#/parameters/skipParam'
- $ref: '#/parameters/limitParam'
responses:
'200':
description: pet response
schema:
type: array
items:
$ref: '#/definitions/Pet'
default:
description: error payload
schema:
$ref: '#/definitions/ErrorModel'
parameters:
skipParam:
name: skip
in: query
description: number of items to skip
required: true
type: integer
format: int32
limitParam:
name: limit
in: query
description: max records to return
required: true
type: integer
format: int32
definitions:
Pet:
required:
- name
properties:
name:
type: string
tag:
type: string
ErrorModel:
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment