|
210 | 210 | "spec":[{ |
211 | 211 | "verb":"POST", |
212 | 212 | "name":"/api/manage", |
| 213 | + "summary":"Change an account data.", |
| 214 | + "description":"Requires authorization", |
| 215 | + "fields":[{ |
| 216 | + "name":"avatar", |
| 217 | + "type":"string", |
| 218 | + "description":"", |
| 219 | + "required":true, |
| 220 | + "validators":[ |
| 221 | + {"name":"maxLength","value":249} |
| 222 | + ] |
| 223 | + },{ |
| 224 | + "name":"languages", |
| 225 | + "type":"string", |
| 226 | + "description":"", |
| 227 | + "required":true, |
| 228 | + "validators":[ |
| 229 | + {"name":"maxLength","value":249} |
| 230 | + ] |
| 231 | + },{ |
| 232 | + "name":"nickname", |
| 233 | + "type":"string", |
| 234 | + "description":"", |
| 235 | + "required":true, |
| 236 | + "validators":[ |
| 237 | + {"name":"maxLength","value":20}, |
| 238 | + {"name":"minLength","value":3}, |
| 239 | + {"name":"pattern","value":"^[^\\s].{1,18}[^\\s]$"} |
| 240 | + ] |
| 241 | + },{ |
| 242 | + "name":"statusInfo", |
| 243 | + "type":"string", |
| 244 | + "description":"", |
| 245 | + "required":true, |
| 246 | + "validators":[ |
| 247 | + {"name":"maxLength","value":249} |
| 248 | + ] |
| 249 | + }], |
| 250 | + "clientMessage":{ |
| 251 | + "avatar": "1.jpg", |
| 252 | + "languages": "RUSSIAN", |
| 253 | + "nickname": "admin2018", |
| 254 | + "statusInfo": "Never be afraid to change something in your life. Sometimes it's useful." |
| 255 | + }, |
| 256 | + "serverMessage":{ |
| 257 | + "success":{ |
| 258 | + "status":200, |
| 259 | + "description":"Returns empty result with status 200 OK." |
| 260 | + }, |
| 261 | + "errors":[{ |
| 262 | + "status":400, |
| 263 | + "description":"If the model is invalid.", |
| 264 | + "data":{ |
| 265 | + "errorCode": 1, |
| 266 | + "message": "Field XXX is required" |
| 267 | + } |
| 268 | + },{ |
| 269 | + "status":401, |
| 270 | + "description":"If the 'Authorization' header is invalid." |
| 271 | + }] |
| 272 | + } |
| 273 | + },{ |
| 274 | + "verb":"POST", |
| 275 | + "name":"/api/manage/password", |
213 | 276 | "summary":"Change a password for your account.", |
214 | | - "description":"So soon...", |
215 | | - "fields":[], |
216 | | - "clientMessage":{}, |
| 277 | + "description":"Requires authorization", |
| 278 | + "fields":[{ |
| 279 | + "name":"oldPassword", |
| 280 | + "type":"string", |
| 281 | + "description":"", |
| 282 | + "required":true, |
| 283 | + "validators":[ |
| 284 | + {"name":"maxLength","value":249}, |
| 285 | + {"name":"minLength","value":8} |
| 286 | + ] |
| 287 | + },{ |
| 288 | + "name":"password", |
| 289 | + "type":"string", |
| 290 | + "description":"", |
| 291 | + "required":true, |
| 292 | + "validators":[ |
| 293 | + {"name":"maxLength","value":249}, |
| 294 | + {"name":"minLength","value":8} |
| 295 | + ] |
| 296 | + },{ |
| 297 | + "name":"passwordRepeat", |
| 298 | + "type":"string", |
| 299 | + "description":"", |
| 300 | + "required":true, |
| 301 | + "validators":[ |
| 302 | + {"name":"should be equal to","value":"password"} |
| 303 | + ] |
| 304 | + }], |
| 305 | + "clientMessage":{ |
| 306 | + "oldPassword": "12345678", |
| 307 | + "password": "t0p_s3cr3t", |
| 308 | + "passwordRepeat": "t0p_s3cr3t" |
| 309 | + }, |
217 | 310 | "serverMessage":{ |
218 | | - "success":{}, |
219 | | - "errors":[] |
| 311 | + "success":{ |
| 312 | + "status":200, |
| 313 | + "description":"Returns empty result with status 200 OK." |
| 314 | + }, |
| 315 | + "errors":[{ |
| 316 | + "status":400, |
| 317 | + "description":"If the model is invalid.", |
| 318 | + "data":{ |
| 319 | + "errorCode": 1, |
| 320 | + "message": "Field XXX is required" |
| 321 | + } |
| 322 | + },{ |
| 323 | + "status":401, |
| 324 | + "description":"If the 'Authorization' header is invalid." |
| 325 | + },{ |
| 326 | + "status":403, |
| 327 | + "description":"If oldPassword is invalid." |
| 328 | + }] |
220 | 329 | } |
221 | 330 | },{ |
222 | 331 | "verb":"DELETE", |
|
0 commit comments