| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- get:
- summary: List all workouts for the current user
- operationId: listWorkouts
- tags:
- - Workouts
- security:
- - cookieAuth: []
- responses:
- '200':
- description: Array of workouts belonging to the authenticated user.
- content:
- application/json:
- schema:
- type: array
- items:
- type: object
- required:
- - id
- - name
- properties:
- id:
- type: string
- format: uuid
- example: 0191a23b-dead-7000-beef-000000000002
- name:
- type: string
- example: Push Day
- example:
- - id: 0191a23b-dead-7000-beef-000000000002
- name: Push Day
- - id: 0191a23b-dead-7000-beef-000000000005
- name: Pull Day
- '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
- '500':
- description: Internal server error.
- content:
- application/json:
- schema:
- $ref: '../components/schemas/ErrorResponse.yaml'
- post:
- summary: Create a new workout
- operationId: createWorkout
- tags:
- - Workouts
- security:
- - cookieAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- required:
- - name
- - exercises
- properties:
- name:
- type: string
- example: Push Day
- exercises:
- type: array
- items:
- type: object
- required:
- - name
- - exercise_type
- - position
- properties:
- name:
- type: string
- example: Bench Press
- exercise_type:
- $ref: '../components/schemas/ExerciseType.yaml'
- position:
- type: integer
- description: 1-based position of the exercise within the workout.
- example: 1
- example:
- name: Push Day
- exercises:
- - name: Bench Press
- exercise_type: WeightedReps
- position: 1
- - name: Push-ups
- exercise_type: BodyweightReps
- position: 2
- - name: Treadmill
- exercise_type: Cardio
- position: 3
- responses:
- '201':
- description: Workout created. Returns the generated workout ID.
- content:
- application/json:
- schema:
- type: object
- required:
- - id
- properties:
- id:
- type: string
- format: uuid
- example: 0191a23b-dead-7000-beef-000000000002
- '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
- '500':
- description: Internal server error.
- content:
- application/json:
- schema:
- $ref: '../components/schemas/ErrorResponse.yaml'
|