|
| 1 | +--- |
| 2 | +openapi: 3.0.0 |
| 3 | +info: |
| 4 | + title: User API |
| 5 | + description: A notifications proof of concept API |
| 6 | + contact: |
| 7 | + |
| 8 | + license: |
| 9 | + name: Apache 2.0 |
| 10 | + url: http://www.apache.org/licenses/LICENSE-2.0.html |
| 11 | + version: 0.1.0 |
| 12 | +servers: |
| 13 | +- url: http://localhost:8080 |
| 14 | + description: localhost test endpoint |
| 15 | +tags: |
| 16 | +- name: Notifications API |
| 17 | + description: Notifications operations |
| 18 | +paths: |
| 19 | + /ping: |
| 20 | + get: |
| 21 | + tags: |
| 22 | + - Notifications API |
| 23 | + summary: tests this api |
| 24 | + description: returns the hostname of the server running this service |
| 25 | + operationId: ping |
| 26 | + responses: |
| 27 | + "201": |
| 28 | + description: server responded |
| 29 | + content: |
| 30 | + application/json: |
| 31 | + schema: |
| 32 | + $ref: '#/components/schemas/PingResponse' |
| 33 | + /addNotification: |
| 34 | + put: |
| 35 | + tags: |
| 36 | + - Notifications API |
| 37 | + summary: adds a new notification |
| 38 | + description: Adds a new notification to the system |
| 39 | + operationId: addNotification |
| 40 | + requestBody: |
| 41 | + description: the notification to add |
| 42 | + content: |
| 43 | + application/json: |
| 44 | + schema: |
| 45 | + $ref: '#/components/schemas/NotificationDetails' |
| 46 | + responses: |
| 47 | + "201": |
| 48 | + description: StatusCreated, notification created |
| 49 | + content: |
| 50 | + application/json: |
| 51 | + schema: |
| 52 | + $ref: '#/components/schemas/Id' |
| 53 | + "400": |
| 54 | + description: StatusBadRequest |
| 55 | + "500": |
| 56 | + description: ServerError |
| 57 | +components: |
| 58 | + schemas: |
| 59 | + PingResponse: |
| 60 | + required: |
| 61 | + - hostname |
| 62 | + type: object |
| 63 | + properties: |
| 64 | + hostname: |
| 65 | + type: string |
| 66 | + example: localhost |
| 67 | + NotificationDetails: |
| 68 | + required: |
| 69 | + - notificationType |
| 70 | + - notificationText |
| 71 | + type: object |
| 72 | + properties: |
| 73 | + notificationType: |
| 74 | + description: describes the type of notification (0 = none, 1 = email, 2 = sms, 3 = slack) |
| 75 | + type: integer |
| 76 | + example: 1 |
| 77 | + notificationText: |
| 78 | + description: arbitrary notification data |
| 79 | + type: string |
| 80 | + example: some notification data |
| 81 | + Id: |
| 82 | + required: |
| 83 | + - id |
| 84 | + properties: |
| 85 | + id: |
| 86 | + description: the id of a new entity |
| 87 | + type: integer |
| 88 | + example: 123 |
| 89 | + NotificationSocketMessage: |
| 90 | + required: |
| 91 | + - table |
| 92 | + - operation |
| 93 | + - data |
| 94 | + properties: |
| 95 | + table: |
| 96 | + description: describes the database table changed |
| 97 | + type: string |
| 98 | + example: 'notifications' |
| 99 | + operation: |
| 100 | + description: describes the database operation performed |
| 101 | + type: string |
| 102 | + example: 'INSERT' |
| 103 | + data: |
| 104 | + required: |
| 105 | + - id |
| 106 | + - notificationTypeId |
| 107 | + - createdTimestamp |
| 108 | + - notificationText |
| 109 | + - notificationType |
| 110 | + description : notification data |
| 111 | + type: object |
| 112 | + properties: |
| 113 | + id: |
| 114 | + description: the id of the row changed |
| 115 | + type: integer |
| 116 | + example: 6 |
| 117 | + notificationTypeId: |
| 118 | + description: describes the type of notification (0 = none, 1 = email, 2 = sms, 3 = slack) |
| 119 | + type: integer |
| 120 | + example: 1 |
| 121 | + createdTimestamp: |
| 122 | + description: the creation timestamp of the row |
| 123 | + type: string |
| 124 | + example: 01/01/2021 |
| 125 | + notificationText: |
| 126 | + description: notification text data |
| 127 | + type: string |
| 128 | + example: some data |
| 129 | + notificationType: |
| 130 | + description: textual descriptor for notificationTypeId |
| 131 | + type: string |
| 132 | + example: email |
0 commit comments