-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.yaml
41 lines (41 loc) · 919 Bytes
/
api.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
openapi: 3.0.0
info:
title: Shrink API
version: 1.0.0
paths:
/shorten:
post:
summary: Shorten a URL
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
url:
type: string
responses:
'200':
description: Shortened URL
content:
application/json:
schema:
type: object
properties:
shortUrl:
type: string
/{shortCode}:
get:
summary: Redirect to original URL
parameters:
- name: shortCode
in: path
required: true
schema:
type: string
responses:
'302':
description: Redirect to original URL
'404':
description: Short URL not found