| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- get:
- summary: Get a workout
- operationId: getWorkout
- tags:
- - Workouts
- security:
- - cookieAuth: []
- parameters:
- - name: id
- in: path
- required: true
- description: UUID of the workout to retrieve.
- schema:
- type: string
- format: uuid
- example: 0191a23b-dead-7000-beef-000000000002
- responses:
- '200':
- description: Workout with all exercises.
- content:
- application/json:
- schema:
- type: object
- required:
- - id
- - name
- - exercises
- properties:
- id:
- type: string
- format: uuid
- example: 0191a23b-dead-7000-beef-000000000002
- name:
- type: string
- example: Push Day
- exercises:
- type: array
- items:
- type: object
- required:
- - id
- - name
- - exercise_type
- - position
- properties:
- id:
- type: string
- format: uuid
- example: 0191a23b-dead-7000-beef-000000000003
- name:
- type: string
- example: Bench Press
- notes:
- type: string
- nullable: true
- example: Keep elbows tucked
- exercise_type:
- $ref: '../components/schemas/ExerciseType.yaml'
- position:
- type: integer
- description: 1-based position of the exercise within its workout.
- example: 1
- example:
- id: 0191a23b-dead-7000-beef-000000000002
- name: Push Day
- exercises:
- - id: 0191a23b-dead-7000-beef-000000000003
- name: Bench Press
- notes: null
- exercise_type: WeightedReps
- position: 1
- - id: 0191a23b-dead-7000-beef-000000000004
- name: Push-ups
- notes: null
- exercise_type: BodyweightReps
- position: 2
- '401':
- description: Missing or invalid auth token.
- content:
- application/json:
- schema:
- $ref: '../components/schemas/ErrorResponse.yaml'
- examples:
- missing:
- summary: No cookie present
- value:
- error: Missing auth token
- invalid:
- summary: Token invalid or expired
- value:
- error: Invalid auth token
- '404':
- description: Workout not found.
- content:
- application/json:
- schema:
- $ref: '../components/schemas/ErrorResponse.yaml'
- example:
- error: Workout not found
- '500':
- description: Internal server error.
- content:
- application/json:
- schema:
- $ref: '../components/schemas/ErrorResponse.yaml'
|