workout-id.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. get:
  2. summary: Get a workout
  3. operationId: getWorkout
  4. tags:
  5. - Workouts
  6. security:
  7. - cookieAuth: []
  8. parameters:
  9. - name: id
  10. in: path
  11. required: true
  12. description: UUID of the workout to retrieve.
  13. schema:
  14. type: string
  15. format: uuid
  16. example: 0191a23b-dead-7000-beef-000000000002
  17. responses:
  18. '200':
  19. description: Workout with all exercises.
  20. content:
  21. application/json:
  22. schema:
  23. type: object
  24. required:
  25. - id
  26. - name
  27. - exercises
  28. properties:
  29. id:
  30. type: string
  31. format: uuid
  32. example: 0191a23b-dead-7000-beef-000000000002
  33. name:
  34. type: string
  35. example: Push Day
  36. exercises:
  37. type: array
  38. items:
  39. type: object
  40. required:
  41. - id
  42. - name
  43. - exercise_type
  44. - position
  45. properties:
  46. id:
  47. type: string
  48. format: uuid
  49. example: 0191a23b-dead-7000-beef-000000000003
  50. name:
  51. type: string
  52. example: Bench Press
  53. notes:
  54. type: string
  55. nullable: true
  56. example: Keep elbows tucked
  57. exercise_type:
  58. $ref: '../components/schemas/ExerciseType.yaml'
  59. position:
  60. type: integer
  61. description: 1-based position of the exercise within its workout.
  62. example: 1
  63. example:
  64. id: 0191a23b-dead-7000-beef-000000000002
  65. name: Push Day
  66. exercises:
  67. - id: 0191a23b-dead-7000-beef-000000000003
  68. name: Bench Press
  69. notes: null
  70. exercise_type: WeightedReps
  71. position: 1
  72. - id: 0191a23b-dead-7000-beef-000000000004
  73. name: Push-ups
  74. notes: null
  75. exercise_type: BodyweightReps
  76. position: 2
  77. '401':
  78. description: Missing or invalid auth token.
  79. content:
  80. application/json:
  81. schema:
  82. $ref: '../components/schemas/ErrorResponse.yaml'
  83. examples:
  84. missing:
  85. summary: No cookie present
  86. value:
  87. error: Missing auth token
  88. invalid:
  89. summary: Token invalid or expired
  90. value:
  91. error: Invalid auth token
  92. '404':
  93. description: Workout not found.
  94. content:
  95. application/json:
  96. schema:
  97. $ref: '../components/schemas/ErrorResponse.yaml'
  98. example:
  99. error: Workout not found
  100. '500':
  101. description: Internal server error.
  102. content:
  103. application/json:
  104. schema:
  105. $ref: '../components/schemas/ErrorResponse.yaml'