api.yml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. openapi: 3.0.3
  2. info:
  3. title: User Management API
  4. description: API to manage user accounts with screen names and passwords
  5. version: 1.0.0
  6. paths:
  7. /user:
  8. get:
  9. summary: Get all users
  10. description: Retrieve a list of all user accounts without passwords.
  11. responses:
  12. '200':
  13. description: Successful response containing a list of users without passwords.
  14. content:
  15. application/json:
  16. schema:
  17. type: array
  18. items:
  19. type: object
  20. properties:
  21. screen_name:
  22. type: string
  23. description: The user's screen name.
  24. post:
  25. summary: Create a new user
  26. description: Create a new user account with a screen name and password.
  27. requestBody:
  28. required: true
  29. content:
  30. application/json:
  31. schema:
  32. type: object
  33. properties:
  34. screen_name:
  35. type: string
  36. description: The user's screen name.
  37. password:
  38. type: string
  39. description: The user's password for account creation.
  40. responses:
  41. '201':
  42. description: User account created successfully.
  43. '400':
  44. description: Bad request. Invalid input data.
  45. '409':
  46. description: Conflict. A user with the specified screen name already exists.
  47. /session:
  48. get:
  49. summary: Get active sessions
  50. description: Retrieve a list of active sessions of logged in users.
  51. responses:
  52. '200':
  53. description: Successful response containing a list of active sessions.
  54. content:
  55. application/json:
  56. schema:
  57. type: object
  58. properties:
  59. count:
  60. type: integer
  61. description: The number of active sessions.
  62. sessions:
  63. type: array
  64. items:
  65. type: object
  66. properties:
  67. screen_name:
  68. type: string
  69. description: The screen name associated with the session.
  70. /user/password:
  71. put:
  72. summary: Set a user's password
  73. description: Update the password for a user specified by their screen name.
  74. requestBody:
  75. required: true
  76. content:
  77. application/json:
  78. schema:
  79. type: object
  80. properties:
  81. screen_name:
  82. type: string
  83. description: The screen name of the user whose password is to be updated.
  84. password:
  85. type: string
  86. description: The new password for the user.
  87. responses:
  88. '204':
  89. description: Password updated successfully.
  90. '400':
  91. description: Bad request. Invalid input data.
  92. '404':
  93. description: User not found.