Skip to content

Instantly share code, notes, and snippets.

@kierenj
Created January 11, 2018 07:24
Show Gist options
  • Save kierenj/f3c9de2a7dd4ce330096deda14137fce to your computer and use it in GitHub Desktop.
Save kierenj/f3c9de2a7dd4ce330096deda14137fce to your computer and use it in GitHub Desktop.
{
"swagger": "2.0",
"info": {
"version": "v1",
"title": "API"
},
"basePath": "\/",
"paths": {
"\/categories": {
"get": {
"tags": [
"Categories"
],
"summary": "Gets a list of categories",
"operationId": "CategoriesGet",
"consumes": [
],
"produces": [
],
"responses": {
"200": {
"description": "Success"
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/ErrorResult"
}
}
}
}
},
"post": {
"tags": [
"Categories"
],
"summary": "Creates a new category",
"operationId": "CategoriesPost",
"consumes": [
"application\/json-patch+json",
"application\/json",
"text\/json",
"application\/*+json"
],
"produces": [
],
"parameters": [
{
"name": "request",
"in": "body",
"required": false,
"schema": {
"$ref": "#\/definitions\/CreateCategoryRequest"
}
}
],
"responses": {
"200": {
"description": "Success"
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/ErrorResult"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/ErrorResult"
}
}
}
}
}
},
"\/categories\/{id}": {
"delete": {
"tags": [
"Categories"
],
"summary": "Deletes a category by ID",
"operationId": "CategoriesByIdDelete",
"consumes": [
],
"produces": [
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string",
"format": "uuid"
}
],
"responses": {
"200": {
"description": "Success"
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/ErrorResult"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/ErrorResult"
}
}
}
}
}
},
"\/functions": {
"get": {
"tags": [
"Functions"
],
"summary": "Gets a list of functions",
"operationId": "FunctionsGet",
"consumes": [
],
"produces": [
],
"responses": {
"200": {
"description": "Success"
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/ErrorResult"
}
}
}
}
}
},
"\/setup\/initialise": {
"post": {
"tags": [
"System Setup"
],
"summary": "Initalises the environment \/ system",
"operationId": "SetupInitialisePost",
"consumes": [
],
"produces": [
],
"responses": {
"200": {
"description": "Success"
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/ErrorResult"
}
}
}
}
}
}
},
"definitions": {
"CreateCategoryRequest": {
"required": [
"name",
"description"
],
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
}
}
},
"ErrorResult": {
"type": "object",
"properties": {
"code": {
"format": "int32",
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
},
"securityDefinitions": {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment