Skip to content

schedule list fails with specialization validation error (400) #17

@0xble

Description

@0xble

Summary

eightctl schedule list fails on GET /users/<userId>/temperature/schedules with a specialization validation error, even when using allowed specialization values.

Repro

eightctl schedule list -v

Actual

Request hits:

GET https://app-api.8slp.net/v1/users/<userId>/temperature/schedules?specialization=all

Response:

{
  "status": 400,
  "errors": {
    "specialization": ["only 'pod|pillow|all' specialization allowed"]
  }
}

This reproduces for specialization=pod, pillow, and all.

Expected

schedule list should return schedules (or empty list), not hard-fail.

Suggested Fix

  1. Keep requesting specialization=all on /temperature/schedules.
  2. If API still returns this validation error, gracefully fallback to:
    • GET /household/users/<userId>/schedule
  3. Return empty schedules when both are unavailable, instead of aborting.

I have implemented and use this fix on a local fork, feel free to reference my implementation diff: https://gist.github.com/0xble/fb74b5b522bf1b9af986e81ff25c8ee4

Environment

  • macOS (Apple Silicon)
  • eightctl 0.1.0-dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions