openapi: 3.1.0
info:
  title: Fitness Tracker API
  description: Read-only API for weight-training workout records.
  version: 0.1.0
paths:
  /:
    get:
      summary: Main Page
      operationId: main_page__get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
  /years:
    get:
      summary: List Years
      operationId: list_years_years_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  type: integer
                type: array
                title: Response List Years Years Get
      security:
      - APIKeyHeader: []
  /workouts:
    get:
      summary: List Workouts
      operationId: list_workouts_workouts_get
      security:
      - APIKeyHeader: []
      parameters:
      - name: year
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            maximum: 2100
            minimum: 1900
          - type: 'null'
          title: Year
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 50
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: order
        in: query
        required: false
        schema:
          enum:
          - asc
          - desc
          type: string
          default: desc
          title: Order
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkoutPage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /workouts/{workout_id}:
    get:
      summary: Get Workout
      operationId: get_workout_workouts__workout_id__get
      security:
      - APIKeyHeader: []
      parameters:
      - name: workout_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workout Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkoutDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /data:
    get:
      summary: Get Data
      operationId: get_data_data_get
      deprecated: true
      security:
      - APIKeyHeader: []
      parameters:
      - name: year
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            maximum: 2100
            minimum: 1900
          - type: 'null'
          title: Year
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 100
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: order
        in: query
        required: false
        schema:
          enum:
          - asc
          - desc
          type: string
          default: desc
          title: Order
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WorkoutDetail'
                title: Response Get Data Data Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /dates:
    get:
      summary: Get Dates
      operationId: get_dates_dates_get
      deprecated: true
      security:
      - APIKeyHeader: []
      parameters:
      - name: year
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            maximum: 2100
            minimum: 1900
          - type: 'null'
          title: Year
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  format: date
                title: Response Get Dates Dates Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /dates_and_splits:
    get:
      summary: Get Dates And Splits
      operationId: get_dates_and_splits_dates_and_splits_get
      deprecated: true
      security:
      - APIKeyHeader: []
      parameters:
      - name: year
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            maximum: 2100
            minimum: 1900
          - type: 'null'
          title: Year
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WorkoutSummary'
                title: Response Get Dates And Splits Dates And Splits Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /dates/{workout_date}:
    get:
      summary: Describe Workout
      operationId: describe_workout_dates__workout_date__get
      deprecated: true
      security:
      - APIKeyHeader: []
      parameters:
      - name: workout_date
        in: path
        required: true
        schema:
          type: string
          format: date
          title: Workout Date
      - name: year
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            maximum: 2100
            minimum: 1900
          - type: 'null'
          title: Year
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WorkoutDetail'
                title: Response Describe Workout Dates  Workout Date  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /{workout_date}/exercises/{exercise}:
    get:
      summary: Show Exercise
      operationId: show_exercise__workout_date__exercises__exercise__get
      deprecated: true
      security:
      - APIKeyHeader: []
      parameters:
      - name: workout_date
        in: path
        required: true
        schema:
          type: string
          format: date
          title: Workout Date
      - name: exercise
        in: path
        required: true
        schema:
          type: string
          title: Exercise
      - name: year
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            maximum: 2100
            minimum: 1900
          - type: 'null'
          title: Year
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExerciseSetResponse'
                title: Response Show Exercise  Workout Date  Exercises  Exercise  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ExerciseSetResponse:
      properties:
        set_number:
          type: integer
          title: Set Number
        reps:
          type: integer
          title: Reps
        weight:
          type: string
          title: Weight
        duration:
          anyOf:
          - type: string
          - type: 'null'
          title: Duration
      additionalProperties: true
      type: object
      required:
      - set_number
      - reps
      - weight
      title: ExerciseSetResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MessageResponse:
      properties:
        message:
          type: string
          title: Message
      type: object
      required:
      - message
      title: MessageResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    WorkoutDetail:
      properties:
        date:
          type: string
          format: date
          title: Date
        split:
          anyOf:
          - type: string
          - type: 'null'
          title: Split
        start_time:
          anyOf:
          - type: string
          - type: 'null'
          title: Start Time
        end_time:
          anyOf:
          - type: string
          - type: 'null'
          title: End Time
        timezone:
          anyOf:
          - type: string
          - type: 'null'
          title: Timezone
        id:
          type: string
          format: uuid
          title: Id
        year:
          type: integer
          title: Year
        exercise_count:
          type: integer
          title: Exercise Count
        set_count:
          type: integer
          title: Set Count
        exercises:
          additionalProperties:
            items:
              $ref: '#/components/schemas/ExerciseSetResponse'
            type: array
          type: object
          title: Exercises
      type: object
      required:
      - date
      - id
      - year
      - exercise_count
      - set_count
      - exercises
      title: WorkoutDetail
    WorkoutPage:
      properties:
        items:
          items:
            $ref: '#/components/schemas/WorkoutSummary'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        limit:
          type: integer
          title: Limit
        offset:
          type: integer
          title: Offset
        year:
          type: integer
          title: Year
      type: object
      required:
      - items
      - total
      - limit
      - offset
      - year
      title: WorkoutPage
    WorkoutSummary:
      properties:
        date:
          type: string
          format: date
          title: Date
        split:
          anyOf:
          - type: string
          - type: 'null'
          title: Split
        start_time:
          anyOf:
          - type: string
          - type: 'null'
          title: Start Time
        end_time:
          anyOf:
          - type: string
          - type: 'null'
          title: End Time
        timezone:
          anyOf:
          - type: string
          - type: 'null'
          title: Timezone
        id:
          type: string
          format: uuid
          title: Id
        year:
          type: integer
          title: Year
        exercise_count:
          type: integer
          title: Exercise Count
        set_count:
          type: integer
          title: Set Count
      type: object
      required:
      - date
      - id
      - year
      - exercise_count
      - set_count
      title: WorkoutSummary
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
