|
| 1 | +openapi: 3.0.3 |
| 2 | +info: |
| 3 | + title: User API for Speakeasy template service |
| 4 | + description: The Rest Template API is an API used for instrucitonal purposes. |
| 5 | + version: 0.1.0 |
| 6 | + contact: |
| 7 | + name: Speakeasy DevRel |
| 8 | + email: nolan@speakeasyapi.dev |
| 9 | +servers: |
| 10 | + - url: http://localhost:8080 |
| 11 | +paths: |
| 12 | + /v1/user: |
| 13 | + post: |
| 14 | + operationId: createUserv1 |
| 15 | + summary: Create user |
| 16 | + requestBody: |
| 17 | + required: true |
| 18 | + content: |
| 19 | + application/json: |
| 20 | + schema: |
| 21 | + $ref: "#/components/schemas/User" |
| 22 | + responses: |
| 23 | + "200": |
| 24 | + content: |
| 25 | + application/json: |
| 26 | + schema: |
| 27 | + $ref: "#/components/schemas/User" |
| 28 | + description: OK |
| 29 | + default: |
| 30 | + $ref: "#/components/responses/default" |
| 31 | + /v1/user/{id}: |
| 32 | + get: |
| 33 | + operationId: getUserv1 |
| 34 | + summary: Get a user by ID |
| 35 | + parameters: |
| 36 | + - in: path |
| 37 | + name: id |
| 38 | + schema: |
| 39 | + type: string |
| 40 | + required: true |
| 41 | + description: Numeric ID of the user to get |
| 42 | + responses: |
| 43 | + "200": |
| 44 | + content: |
| 45 | + application/json: |
| 46 | + schema: |
| 47 | + $ref: "#/components/schemas/User" |
| 48 | + description: OK |
| 49 | + default: |
| 50 | + $ref: "#/components/responses/default" |
| 51 | + put: |
| 52 | + operationId: updateUserv1 |
| 53 | + parameters: |
| 54 | + - in: path |
| 55 | + name: id |
| 56 | + schema: |
| 57 | + type: string |
| 58 | + required: true |
| 59 | + description: UserID |
| 60 | + requestBody: |
| 61 | + required: true |
| 62 | + content: |
| 63 | + application/json: |
| 64 | + schema: |
| 65 | + $ref: "#/components/schemas/User" |
| 66 | + responses: |
| 67 | + "200": |
| 68 | + content: |
| 69 | + application/json: |
| 70 | + schema: |
| 71 | + $ref: "#/components/schemas/User" |
| 72 | + description: OK |
| 73 | + default: |
| 74 | + $ref: "#/components/responses/default" |
| 75 | + delete: |
| 76 | + operationId: deleteUserv1 |
| 77 | + summary: Delete a user by ID |
| 78 | + parameters: |
| 79 | + - in: path |
| 80 | + name: id |
| 81 | + schema: |
| 82 | + type: string |
| 83 | + required: true |
| 84 | + description: UserID |
| 85 | + responses: |
| 86 | + "200": |
| 87 | + content: |
| 88 | + application/json: |
| 89 | + schema: |
| 90 | + $ref: "#/components/schemas/Success" |
| 91 | + description: OK |
| 92 | + default: |
| 93 | + $ref: "#/components/responses/default" |
| 94 | + /v1/users/search: |
| 95 | + post: |
| 96 | + operationId: searchUsersv1 |
| 97 | + summary: Search users |
| 98 | + requestBody: |
| 99 | + required: true |
| 100 | + content: |
| 101 | + application/json: |
| 102 | + schema: |
| 103 | + $ref: "#/components/schemas/Filters" |
| 104 | + responses: |
| 105 | + "200": |
| 106 | + content: |
| 107 | + application/json: |
| 108 | + schema: |
| 109 | + $ref: "#/components/schemas/Users" |
| 110 | + description: OK |
| 111 | + /health: |
| 112 | + get: |
| 113 | + operationId: getHealth |
| 114 | + summary: Healthcheck |
| 115 | + responses: |
| 116 | + "200": |
| 117 | + description: OK |
| 118 | + default: |
| 119 | + $ref: "#/components/responses/default" |
| 120 | +components: |
| 121 | + responses: |
| 122 | + default: |
| 123 | + content: |
| 124 | + application/json: |
| 125 | + schema: |
| 126 | + $ref: "#/components/schemas/Error" |
| 127 | + description: Default error response |
| 128 | + schemas: |
| 129 | + Success: |
| 130 | + description: The `Status` type defines a successful response. |
| 131 | + properties: |
| 132 | + success: |
| 133 | + type: boolean |
| 134 | + type: object |
| 135 | + Error: |
| 136 | + description: The `Status` type defines a logical error model |
| 137 | + properties: |
| 138 | + message: |
| 139 | + description: A developer-facing error message. |
| 140 | + type: string |
| 141 | + status_code: |
| 142 | + description: The HTTP status code |
| 143 | + format: int32 |
| 144 | + type: integer |
| 145 | + required: |
| 146 | + - message |
| 147 | + - status_code |
| 148 | + type: object |
| 149 | + Filter: |
| 150 | + description: Filters are used to query requests. |
| 151 | + properties: |
| 152 | + field: |
| 153 | + type: string |
| 154 | + matchtype: |
| 155 | + type: string |
| 156 | + value: |
| 157 | + type: string |
| 158 | + required: |
| 159 | + - field |
| 160 | + - matchtype |
| 161 | + - value |
| 162 | + type: object |
| 163 | + Filters: |
| 164 | + description: An array of filters are used to query requests. |
| 165 | + properties: |
| 166 | + filters: |
| 167 | + description: A list of filters to apply to the query. |
| 168 | + items: |
| 169 | + $ref: "#/components/schemas/Filter" |
| 170 | + type: array |
| 171 | + limit: |
| 172 | + description: The maximum number of results to return. |
| 173 | + type: integer |
| 174 | + offset: |
| 175 | + description: The offset to start the query from. |
| 176 | + type: integer |
| 177 | + required: |
| 178 | + - filters |
| 179 | + - limit |
| 180 | + - offset |
| 181 | + type: object |
| 182 | + User: |
| 183 | + description: The details of a typical user account |
| 184 | + properties: |
| 185 | + id: |
| 186 | + type: string |
| 187 | + format: uuid |
| 188 | + readOnly: true |
| 189 | + firstname: |
| 190 | + type: string |
| 191 | + lastname: |
| 192 | + type: string |
| 193 | + nickname: |
| 194 | + type: string |
| 195 | + password: |
| 196 | + type: string |
| 197 | + email: |
| 198 | + type: string |
| 199 | + format: email |
| 200 | + country: |
| 201 | + type: string |
| 202 | + createdate: |
| 203 | + format: date-time |
| 204 | + type: string |
| 205 | + readOnly: true |
| 206 | + updatedate: |
| 207 | + format: date-time |
| 208 | + type: string |
| 209 | + readOnly: true |
| 210 | + required: |
| 211 | + - firstname |
| 212 | + - lastname |
| 213 | + - nickname |
| 214 | + - password |
| 215 | + - email |
| 216 | + - country |
| 217 | + type: object |
| 218 | + Users: |
| 219 | + description: An array of users. |
| 220 | + properties: |
| 221 | + users: |
| 222 | + description: A list of users to return. |
| 223 | + items: |
| 224 | + $ref: "#/components/schemas/User" |
| 225 | + type: array |
| 226 | + required: |
| 227 | + - users |
| 228 | + type: object |
0 commit comments