diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2023-01-05 21:10:26 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2023-01-05 21:10:26 -0500 |
| commit | 1e1cd261dd9c944f595c9023c8aa3e76aae751af (patch) | |
| tree | 7b18c557dc38cb0dcc99f15a489298c1bd54f40f /docs/swagger.yaml | |
| parent | c71b37eb23d4c8af7ab983de34c6da5be9363f3a (diff) | |
| download | paste-1e1cd261dd9c944f595c9023c8aa3e76aae751af.tar.gz paste-1e1cd261dd9c944f595c9023c8aa3e76aae751af.tar.xz | |
Start on swagger docsswagger
Diffstat (limited to 'docs/swagger.yaml')
| -rw-r--r-- | docs/swagger.yaml | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/docs/swagger.yaml b/docs/swagger.yaml new file mode 100644 index 0000000..bcff994 --- /dev/null +++ b/docs/swagger.yaml @@ -0,0 +1,108 @@ +basePath: /api +definitions: + main.Credentials: + description: User's credentials + properties: + Password: + type: string + Username: + type: string + type: object +info: + contact: + email: mitch@riedstra.dev + name: Mitchell Riedstra + url: https://riedstra.dev + description: User's credentials + license: + name: ISC + title: Simple Pastebin API + version: "1.0" +paths: + /v0/del/{id}: + delete: + description: Remove a paste from the filesystem + parameters: + - description: Paste ID + in: path + name: id + required: true + type: string + produces: + - text/plain + responses: {} + summary: Deletes a paste for a given ID + tags: + - v0 + /v0/view/{id}: + get: + description: Fetches the contents of a paste if given an ID + parameters: + - description: Paste ID + in: path + name: id + required: true + type: string + produces: + - text/plain + responses: {} + summary: View a paste for a given ID + tags: + - v0 + /v1/del/{id}: + delete: + description: Remove a paste from the filesystem + parameters: + - description: Paste ID + in: path + name: id + required: true + type: string + produces: + - application/json + responses: {} + summary: Deletes a paste for a given ID + tags: + - v1 + /v1/getToken: + post: + consumes: + - application/json + description: Returns an API key that's valid for a pre-determined amount of + hours + parameters: + - description: User Credentials + in: body + name: request + required: true + schema: + $ref: '#/definitions/main.Credentials' + produces: + - application/json + responses: {} + summary: Get an API key with valid credentials + tags: + - v1 + /v1/view/{id}: + get: + description: Fetches the contents of a paste if given an ID + parameters: + - description: Paste ID + in: path + name: id + required: true + type: string + produces: + - application/json + responses: {} + summary: View a paste for a given ID + tags: + - v1 +securityDefinitions: + "": + in: header + name: Authorization + type: apiKey + BasicAuth: + type: basic +swagger: "2.0" |
