diff options
Diffstat (limited to 'docs/swagger.json')
| -rw-r--r-- | docs/swagger.json | 158 |
1 files changed, 158 insertions, 0 deletions
diff --git a/docs/swagger.json b/docs/swagger.json new file mode 100644 index 0000000..27c60a0 --- /dev/null +++ b/docs/swagger.json @@ -0,0 +1,158 @@ +{ + "swagger": "2.0", + "info": { + "description": "User's credentials", + "title": "Simple Pastebin API", + "contact": { + "name": "Mitchell Riedstra", + "url": "https://riedstra.dev", + "email": "mitch@riedstra.dev" + }, + "license": { + "name": "ISC" + }, + "version": "1.0" + }, + "basePath": "/api", + "paths": { + "/v0/del/{id}": { + "delete": { + "description": "Remove a paste from the filesystem", + "produces": [ + "text/plain" + ], + "tags": [ + "v0" + ], + "summary": "Deletes a paste for a given ID", + "parameters": [ + { + "type": "string", + "description": "Paste ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": {} + } + }, + "/v0/view/{id}": { + "get": { + "description": "Fetches the contents of a paste if given an ID", + "produces": [ + "text/plain" + ], + "tags": [ + "v0" + ], + "summary": "View a paste for a given ID", + "parameters": [ + { + "type": "string", + "description": "Paste ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": {} + } + }, + "/v1/del/{id}": { + "delete": { + "description": "Remove a paste from the filesystem", + "produces": [ + "application/json" + ], + "tags": [ + "v1" + ], + "summary": "Deletes a paste for a given ID", + "parameters": [ + { + "type": "string", + "description": "Paste ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": {} + } + }, + "/v1/getToken": { + "post": { + "description": "Returns an API key that's valid for a pre-determined amount of hours", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "v1" + ], + "summary": "Get an API key with valid credentials", + "parameters": [ + { + "description": "User Credentials", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/main.Credentials" + } + } + ], + "responses": {} + } + }, + "/v1/view/{id}": { + "get": { + "description": "Fetches the contents of a paste if given an ID", + "produces": [ + "application/json" + ], + "tags": [ + "v1" + ], + "summary": "View a paste for a given ID", + "parameters": [ + { + "type": "string", + "description": "Paste ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": {} + } + } + }, + "definitions": { + "main.Credentials": { + "description": "User's credentials", + "type": "object", + "properties": { + "Password": { + "type": "string" + }, + "Username": { + "type": "string" + } + } + } + }, + "securityDefinitions": { + "": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + }, + "BasicAuth": { + "type": "basic" + } + } +}
\ No newline at end of file |
