Skip to content

Commit

Permalink
Merge pull request #7 from BurningFlipside/feature/apidoc
Browse files Browse the repository at this point in the history
create swagger documentation for ThemeRegistration API
  • Loading branch information
pboyd04 committed Jun 8, 2017
2 parents 9c59f31 + 9843523 commit 5fd0843
Show file tree
Hide file tree
Showing 2 changed files with 377 additions and 0 deletions.
224 changes: 224 additions & 0 deletions api/v1/swagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
{
"swagger": "2.0",
"info": {
"version": "0.0.1",
"title": "Burning Flipside Volunteer System API",
"description": "Theme Registration API",
"contact": {
"name": "Technology Team",
"email": "[email protected]"
}
},
"host": "secure.burningflipside.com",
"schemes": [
"https"
],
"basePath": "/themes/api/v1",
"produces": [
"application/json"
],
"paths": {
"/": {
"get": {
"summary": "List submitted themes",
"description": "",
"tags": [
"Themes"
],
"responses": {
"200": {
"description": "An array of themes",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Theme"
}
}
},
"default": {
"description": "error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"post": {
"summary": "Create a new Theme",
"description": "Create a new theme entry\n",
"tags": [
"Themes"
],
"parameters": [
{
"name": "theme",
"in": "body",
"description": "The theme data to create",
"required": true,
"schema": {
"$ref": "#/definitions/Theme"
}
}
],
"responses": {
"201": {
"description": "An array of themes",
"headers": {
"Location": {
"description": "The URI for the new theme",
"type": "string"
}
}
},
"default": {
"description": "error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/{id}": {
"get": {
"summary": "Get Single Theme",
"description": "Returns the single theme specified by the name",
"tags": [
"Themes"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "The id for the theme",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "A theme",
"schema": {
"$ref": "#/definitions/Theme"
}
},
"404": {
"description": "record not found"
},
"default": {
"description": "error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"patch": {
"summary": "Update Department",
"description": "Modify one or more fields in the theme",
"tags": [
"Themes"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "The id for the theme",
"required": true,
"type": "string"
},
{
"name": "theme",
"in": "body",
"description": "The theme data to edit",
"required": true,
"schema": {
"$ref": "#/definitions/Theme"
}
}
],
"responses": {
"200": {
"description": "The edited theme object",
"schema": {
"$ref": "#/definitions/Theme"
}
},
"404": {
"description": "record not found"
},
"default": {
"description": "error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"delete": {
"summary": "Delete Department",
"description": "Delete a department",
"tags": [
"Themes"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "The id for the theme",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The requested theme was deleted"
},
"404": {
"description": "record not found"
},
"default": {
"description": "error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Theme": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The unique id for the theme."
},
"name": {
"type": "string",
"description": "The name for the theme."
},
"presenting": {
"type": "boolean",
"description": "Will there be a theme presentation at town hall."
}
}
},
"Error": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"fields": {
"type": "string"
}
}
}
}
}
153 changes: 153 additions & 0 deletions api/v1/swagger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
swagger: '2.0'
info:
version: "0.0.1"
title: Burning Flipside Volunteer System API
description: Theme Registration API
contact:
name: Technology Team
email: [email protected]
host: secure.burningflipside.com
schemes:
- https
basePath: /themes/api/v1
produces:
- application/json
paths:
/:
get:
summary: List submitted themes
description: |
tags:
- Themes
responses:
200:
description: An array of themes
schema:
type: array
items:
$ref: '#/definitions/Theme'
default:
description: error
schema:
$ref: '#/definitions/Error'
post:
summary: Create a new Theme
description: |
Create a new theme entry
tags:
- Themes
parameters:
- name: theme
in: body
description: The theme data to create
required: true
schema:
$ref: '#/definitions/Theme'
responses:
201:
description: An array of themes
headers:
Location:
description: The URI for the new theme
type: string
default:
description: error
schema:
$ref: '#/definitions/Error'
/{id}:
get:
summary: Get Single Theme
description: Returns the single theme specified by the name
tags:
- Themes
parameters:
- name: id
in: path
description: The id for the theme
required: true
type: string
responses:
200:
description: A theme
schema:
$ref: '#/definitions/Theme'
404:
description: record not found
default:
description: error
schema:
$ref: '#/definitions/Error'
patch:
summary: Update Department
description: Modify one or more fields in the theme
tags:
- Themes
parameters:
- name: id
in: path
description: The id for the theme
required: true
type: string
- name: theme
in: body
description: The theme data to edit
required: true
schema:
$ref: '#/definitions/Theme'
responses:
200:
description: The edited theme object
schema:
$ref: '#/definitions/Theme'
404:
description: record not found
default:
description: error
schema:
$ref: '#/definitions/Error'
delete:
summary: Delete Department
description: Delete a department
tags:
- Themes
parameters:
- name: id
in: path
description: The id for the theme
required: true
type: string
responses:
200:
description: The requested theme was deleted
404:
description: record not found
default:
description: error
schema:
$ref: '#/definitions/Error'

definitions:
Theme:
type: object
properties:
id:
type: string
description: The unique id for the theme.
name:
type: string
description: The name for the theme.
presenting:
type: boolean
description: Will there be a theme presentation at town hall.

Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string

0 comments on commit 5fd0843

Please sign in to comment.