workout-id.yaml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. properties:
  45. id:
  46. type: string
  47. format: uuid
  48. example: 0191a23b-dead-7000-beef-000000000003
  49. name:
  50. type: string
  51. example: Bench Press
  52. notes:
  53. type: string
  54. nullable: true
  55. example: Keep elbows tucked
  56. exercise_type:
  57. $ref: '../components/schemas/ExerciseType.yaml'
  58. example:
  59. id: 0191a23b-dead-7000-beef-000000000002
  60. name: Push Day
  61. exercises:
  62. - id: 0191a23b-dead-7000-beef-000000000003
  63. name: Bench Press
  64. notes: null
  65. exercise_type: WeightedReps
  66. - id: 0191a23b-dead-7000-beef-000000000004
  67. name: Push-ups
  68. notes: null
  69. exercise_type: BodyweightReps
  70. '401':
  71. description: Missing or invalid auth token.
  72. content:
  73. application/json:
  74. schema:
  75. $ref: '../components/schemas/ErrorResponse.yaml'
  76. examples:
  77. missing:
  78. summary: No cookie present
  79. value:
  80. error: Missing auth token
  81. invalid:
  82. summary: Token invalid or expired
  83. value:
  84. error: Invalid auth token
  85. '404':
  86. description: Workout not found.
  87. content:
  88. application/json:
  89. schema:
  90. $ref: '../components/schemas/ErrorResponse.yaml'
  91. example:
  92. error: Workout not found
  93. '500':
  94. description: Internal server error.
  95. content:
  96. application/json:
  97. schema:
  98. $ref: '../components/schemas/ErrorResponse.yaml'