Skip to content

Instantly share code, notes, and snippets.

@Lull3rSkat3r
Last active January 15, 2016 22:25
Show Gist options
  • Save Lull3rSkat3r/3f01a102fcfaf5602c7f to your computer and use it in GitHub Desktop.
Save Lull3rSkat3r/3f01a102fcfaf5602c7f to your computer and use it in GitHub Desktop.
A collection of code snippets for the "Words Of Wisdom" API.
{
"swagger": "2.0",
"info": {
"version": "0.0.1",
"title": "Words Of Wisdom",
"description": "An API for recording and reflecting quotes.",
"contact": {
"name": "Corey Stubbs",
"email": "cstubbs@us.ibm.com",
"url": "https://github.com/Lull3rSkat3r"
}
},
"paths": {
"/random": {
"get": {
"description": "Returns a random quote",
"responses": {
"200": {
"description": "A string containing the quote",
"schema": {
"type": "string"
}
}
}
}
},
"/quote": {
"post": {
"description": "Adds a quote",
"parameters": [
{
"name": "body",
"in": "body",
"description": "The quote to be added to the collection",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"201": {
"description": "Returns the id of the newly create quote, which can be used to access the quote",
"schema": {
"type": "integer"
}
}
}
}
},
"/quote/{id}": {
"get": {
"description": "Gets the quote",
"parameters": [
{
"name": "id",
"in": "path",
"description": "The quote to be added to the collection",
"required": true,
"type": "string"
}
],
"responses": {
"201": {
"description": "Returns the id of the quote, which can be used to access the quote",
"schema": {
"type": "integer"
}
}
}
},
"put": {
"description": "Updates the content of quote.",
"parameters": [
{
"name": "id",
"in": "path",
"description": "The quote to be added to the collection",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"description": "The new value of the quote",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "The quote has successfully been updated."
}
}
}
}
}
}
swagger: '2.0'
info:
version: 0.0.1
title: 'Words Of Wisdom'
description: An API for recording and reflecting quotes.
contact:
name: Corey Stubbs
email: cstubbs@us.ibm.com
url: 'https://github.com/Lull3rSkat3r'
paths:
/random:
get:
description: Returns a random quote
responses:
'200':
description: A string containing the quote
schema:
type: string
/quote:
post:
description: Adds a quote
parameters:
- name: body
in: body
description: The quote to be added to the collection
required: true
schema:
type: string
responses:
'201':
description: Returns the id of the newly create quote, which can be used to access the quote
schema:
type: integer
/quote/{id}:
get:
description: Gets the quote
parameters:
- name: id
in: path
description: The quote to be added to the collection
required: true
type: string
responses:
'201':
description: Returns the id of the quote, which can be used to access the quote
schema:
type: integer
put:
description: Updates the content of quote.
parameters:
- name: id
in: path
description: The quote to be added to the collection
required: true
type: string
- name: body
in: body
description: The new value of the quote
required: true
schema:
type: string
responses:
'204':
description: The quote has successfully been updated.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment