Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create swagger documentation for ThemeRegistration API #7

Merged
merged 1 commit into from
Jun 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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