-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
101 lines (100 loc) · 2.98 KB
/
openapi.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
openapi: 3.1.2
info:
title: Shrtr API
description: Shrtr API spec
version: 0.0.1
servers:
- url: https://api.shrtr.cloud
paths:
/generate:
post:
operationId: GenerateShortURL
requestBody:
content:
application/json:
schema:
type: object
required:
- mode
- url
properties:
mode:
type: string
enum:
- random
- identifiable
description: Random mode generates a 6-character random URL path. Identifiable is human readable.
url:
type: string
description: URL to redirect to. Can be prefixed with https or not.
example:
- https://www.shrtr.cloud
- shrtr.cloud
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
required:
- mode
- url
- key
- shortenedURL
properties:
mode:
type: string
example: identifiable
description: The mode the URL was generated using.
url:
type: string
example: https://shrtr.cloud
description: The URL to shorten.
key:
type: string
example: whtcfn
description: The unique shortened key used to access the URL.
shortenedURL:
type: string
example: https://shrtr.cloud/whtcfn
description: The full shortened URL path.
"400":
$ref: "#/components/responses/400"
components:
schemas:
ErrorObject:
type: object
x-sensitive: false
properties:
error:
type: object
x-sensitive: false
properties:
error:
type: string
x-sensitive: false
description: System-friendly error code for this Error.
message:
type: string
x-sensitive: false
description: |-
Human-friendly error message for this Error.
This error message is not intended for end-user presentation.
required:
- code
- message
additionalProperties: false
required:
- error
additionalProperties: false
responses:
"400":
description:
Request provided was not properly formed or did not have all the
required information. See the response body error property for more
details
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorObject"