-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathusers.yaml
More file actions
115 lines (114 loc) · 2.94 KB
/
Copy pathusers.yaml
File metadata and controls
115 lines (114 loc) · 2.94 KB
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
111
112
113
114
# this is an example of the Uber API
# as a demonstration of an API spec in YAML
swagger: '2.0'
info:
title: Blueprint Users API
description: Start development with a blueprint service like this one.
version: "1.0.0"
# the domain of the service
host: localhost
# array of all schemes that your API supports
schemes:
- https
# will be prefixed to all paths
basePath: /api/v1
produces:
- application/json
paths:
/users:
get:
summary: Get Users
description: |
The Get Users endpoint returns a list of all the users in the system.
This identifies them with their first name, last name, and email address
tags:
- Users
responses:
200:
description: An array of Users
schema:
type: array
items:
$ref: '#/definitions/User'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
post:
summary: Create Single User
description: |
The Create Single User endpoint allows the creation of a single user.
The request object must contain all the fields, otherwise they get nulled.
parameters:
- name: user
in: body
description: The user object to create
required: true
schema:
$ref: '#/definitions/User'
tags:
- Users
responses:
201:
description: Successfully created
400:
description: Bad Request error
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/users/{id}:
get:
summary: Get Single User
description: |
The Get Single User endpoint allows the requester to retrieve a single User by that user's id.
parameters:
- name: id
in: path
description: The id of the user to retrieve.
required: true
type: number
format: int64
tags:
- Users
responses:
200:
description: The user based on an id.
schema:
$ref: '#/definitions/User'
404:
description: Not Found error
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
definitions:
User:
type: object
properties:
userId:
type: integer
description: The id of the user record.
firstName:
type: string
description: First name of the user.
lastName:
type: string
description: Last name of the user.
email:
type: string
description: Email address of the user
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string