-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
58 lines (57 loc) · 1.4 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
openapi: 3.0.0
info:
title: url-hasherI
version: 1.0.0
description: API for hashing and accessing hashed URLs
paths:
/api/hash-url:
post:
summary: Create a new hashed URL with given URL
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
url:
type: string
description: The long URL to be hashed
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
hashedURL:
type: string
description: The hashed URL generated for the long URL
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
tags:
- URL
/api/hash-url/{id}:
get:
summary: Redirect to the long URL associated with the hashed URL
parameters:
- in: path
name: id
required: true
schema:
type: string
description: Redirects to original URL
responses:
'302':
description: Found
'400':
description: Bad Request
'500':
description: Internal Server Error
tags:
- URL