| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- 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
- properties:
- name:
- type: string
- example: Bench Press
- exercise_type:
- $ref: '../components/schemas/ExerciseType.yaml'
- example:
- name: Push Day
- exercises:
- - name: Bench Press
- exercise_type: WeightedReps
- - name: Push-ups
- exercise_type: BodyweightReps
- - name: Treadmill
- exercise_type: Cardio
- 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'
|