-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
79 lines (79 loc) · 1.99 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
71
72
73
74
75
76
77
78
79
definitions:
GenericError:
description: GenericError is a generic error message returned by a server
properties:
message:
type: string
x-go-name: Message
type: object
x-go-package: github.com/navendu-pottekkat/students-api/handlers
Student:
properties:
age:
format: int64
type: integer
x-go-name: Age
course:
type: string
x-go-name: Course
id:
type: string
x-go-name: ID
name:
type: string
x-go-name: Name
type: object
x-go-package: github.com/navendu-pottekkat/students-api/data
ValidationError:
description: ValidationError is a collection of validation error messages
properties:
messages:
items:
type: string
type: array
x-go-name: Messages
type: object
x-go-package: github.com/navendu-pottekkat/students-api/handlers
info: {}
paths:
/:
get:
description: Return a list of students from the database
operationId: listStudents
responses:
"200":
$ref: '#/responses/studentsResponse'
tags:
- students
post:
description: Create a new product
operationId: createStudent
responses:
"200":
$ref: '#/responses/studentResponse'
"422":
$ref: '#/responses/errorValidation'
"501":
$ref: '#/responses/errorResponse'
tags:
- students
responses:
errorResponse:
description: Generic error message returned as a string
schema:
$ref: '#/definitions/GenericError'
errorValidation:
description: Validation errors defined as an array of strings
schema:
$ref: '#/definitions/ValidationError'
studentResponse:
description: Data structure representing a single student
schema:
$ref: '#/definitions/Student'
studentsResponse:
description: A list of students
schema:
items:
$ref: '#/definitions/Student'
type: array
swagger: "2.0"