-
Notifications
You must be signed in to change notification settings - Fork 0
/
Swagger.yaml
70 lines (70 loc) · 1.58 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
swagger: "2.0"
info:
description: "This is a simple URL shortening service"
version: "1.0.0"
title: "Urlshortener"
contact:
email: "[email protected]"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "localhost:9000"
basePath: "/"
tags:
- name: "shortener"
description: "Url shortener API"
schemes:
- "http"
paths:
/{short_url}:
get:
tags:
- "shortener"
summary: "Follow a short link"
description: ""
operationId: "lookup"
parameters:
- in: "path"
name: "short_url"
description: "Short url returned by the service"
required: true
type: string
responses:
"302":
description: "Redirect to the associated long url"
"404":
description: "Not found"
/create:
post:
tags:
- "shortener"
summary: "Shorten a long url"
description: ""
operationId: "create"
consumes:
- application/json
parameters:
- in: body
name: long_url
description: ""
required: true
schema:
$ref: '#/definitions/CreateBodyRequest'
responses:
"400":
description: "Bad request"
"201":
description: "Created"
schema:
$ref: '#/definitions/CreateBodyResponse'
definitions:
CreateBodyRequest:
type: "object"
properties:
long_url:
type: "string"
CreateBodyResponse:
type: "object"
properties:
short_url:
type: "string"