forked from HerronTech/soajs.quick.demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yml
executable file
·110 lines (110 loc) · 2.39 KB
/
swagger.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
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
102
103
104
105
106
107
108
109
110
swagger: "2.0"
info:
version: "1.0.0"
title: Quick Demo
host: localhost
basePath: /quickdemo
schemes:
- http
paths:
/user:
post:
tags:
- user
summary: Create user
parameters:
- in: body
name: user
description: Created user object
required: true
schema:
$ref: "#/definitions/item"
responses:
200:
description: successful operation
400:
description: unsuccessful update
600:
description: couldn't establish connection to database
/user/{id}:
get:
tags:
- user
summary: get user by id
parameters:
- $ref: "#/parameters/id"
responses:
200:
description: successful operation
401:
description: user id not found
600:
description: couldn't establish connection to database
delete:
tags:
- user
summary: delete a user by Id
parameters:
- $ref: "#/parameters/id"
responses:
200:
description: successful operation
401:
description: user id not found
600:
description: couldn't establish connection to database
put:
tags:
- user
summary: Update user
parameters:
- $ref: "#/parameters/id"
- $ref: "#/parameters/user"
responses:
200:
description: successful operation
400:
description: unsuccessful update
600:
description: couldn't establish connection to database
parameters:
id:
in: path
name: id
required: true
type: string
user:
in: body
name: user
description: Created user object
required: true
schema:
$ref: "#/definitions/item"
definitions:
item:
type: object
required: [username, email]
properties:
username:
type: string
minLength: 4
maxLength: 8
pattern: /^[a-zA-Z][0-9a-zA-Z_\-]+$/
firstName:
type: string
lastName:
type: string
email:
type: array
items:
type: object
required: [address, primary]
minItems: 1
maxItems: 6
uniqueItems: true
properties:
address:
type: string
format: email
primary:
type: boolean