-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yml
67 lines (65 loc) · 1.52 KB
/
openapi.yml
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
openapi: 3.0.0
info:
version: "1.0.0"
title: "URL Shortener"
paths:
/url-shortener/search:
description: Search an full URL
get:
summary: Gets a full URL by the shortened URL
parameters:
- name: url
in: query
schema:
type: string
responses:
200:
description: Returns the full url corresponding to the short url
content:
application/json:
schema:
$ref: '#/components/schemas/GetURLResponse'
404:
description: The url in not known
/url-shortener/shortens:
description: Creates a shortened URL
post:
summary: Shortens a given URL
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PostURLRequest'
responses:
200:
description: Returns the shortened URL
content:
application/json:
schema:
$ref: '#/components/schemas/PostURLResponse'
400:
description: The url is malformed
components:
schemas:
GetURLResponse:
type: object
properties:
fullUrl:
type: string
required:
- fullUrl
PostURLRequest:
type: object
properties:
url:
type: string
required:
- url
PostURLResponse:
type: object
properties:
shortenedUrl:
type: string
required:
- shortenedUrl