-
Notifications
You must be signed in to change notification settings - Fork 35
/
swagger.yaml
103 lines (102 loc) · 2.84 KB
/
swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
swagger: "2.0"
info:
description: "This is an API of a secret service. You can save your secret by using the API. You can restrict the access of a secret after the certen number of views or after a certen period of time."
version: "1.0.0"
title: "Secret Server"
host: "api.your-secret-server.com"
basePath: "/v1"
tags:
- name: "secret"
externalDocs:
description: "Find out more"
url: "http://swagger.io"
schemes:
- "http"
paths:
/secret:
post:
tags:
- "secret"
summary: "Add a new secret"
description: ""
operationId: "addSecret"
consumes:
- "application/x-www-form-urlencoded"
produces:
- "application/json"
- "application/xml"
parameters:
- in: "formData"
name: "secret"
description: "This text will be saved as a secret"
required: true
type: "string"
- in: "formData"
name: "expireAfterViews"
description: "The secret won't be available after the given number of views. It must be greater than 0."
required: true
type: "integer"
format: "int32"
- in: "formData"
name: "expireAfter"
description: "The secret won't be available after the given time. The value is provided in minutes. 0 means never expires"
required: true
type: "integer"
format: "int32"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/Secret"
405:
description: "Invalid input"
/secret/{hash}:
get:
tags:
- "secret"
summary: "Find a secret by hash"
description: "Returns a single secret"
operationId: "getSecretByHash"
produces:
- "application/json"
- "application/xml"
parameters:
- name: "hash"
in: "path"
description: "Unique hash to identify the secret"
required: true
type: "string"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/Secret"
404:
description: "Secret not found"
definitions:
Secret:
type: "object"
properties:
hash:
type: "string"
description: "Unique hash to identify the secrets"
secretText:
type: "string"
description: "The secret itself"
createdAt:
type: "string"
format: "date-time"
description: "The date and time of the creation"
expiresAt:
type: "string"
format: "date-time"
description: "The secret cannot be reached after this time"
remainingViews:
type: "integer"
format: "int32"
description: "How many times the secret can be viewed"
xml:
name: "Secret"
externalDocs:
description: "Find out more about Swagger"
url: "http://swagger.io"