api.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. $ref: '#/components/schemas/User'
  20. post:
  21. summary: Create a new user
  22. description: Create a new user account with a screen name and password.
  23. requestBody:
  24. required: true
  25. content:
  26. application/json:
  27. schema:
  28. $ref: '#/components/schemas/User'
  29. responses:
  30. '201':
  31. description: User account created successfully.
  32. '400':
  33. description: Bad request. Invalid input data.
  34. /session:
  35. get:
  36. summary: Get active sessions
  37. description: Retrieve a list of active sessions of logged in users.
  38. responses:
  39. '200':
  40. description: Successful response containing a list of active sessions.
  41. content:
  42. application/json:
  43. schema:
  44. $ref: '#/components/schemas/SessionResponse'
  45. components:
  46. schemas:
  47. User:
  48. type: object
  49. properties:
  50. screen_name:
  51. type: string
  52. description: The user's screen name.
  53. SessionResponse:
  54. type: object
  55. properties:
  56. count:
  57. type: integer
  58. description: The number of active sessions.
  59. sessions:
  60. type: array
  61. items:
  62. $ref: '#/components/schemas/Session'
  63. Session:
  64. type: object
  65. properties:
  66. screen_name:
  67. type: string
  68. description: The screen name associated with the session.