{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asterwise-com/json-schema/asterwise-com-api-response-union-biorhythm-single-day-response-biorhythm-range-response-schema.json",
  "title": "ApiResponse[Union[BiorhythmSingleDayResponse, BiorhythmRangeResponse]]",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asterwise-com-western-api-openapi.yml#/components/schemas/ApiResponse_Union_BiorhythmSingleDayResponse__BiorhythmRangeResponse__",
  "properties": {
    "success": {
      "type": "boolean",
      "title": "Success",
      "description": "True if the request succeeded",
      "default": true
    },
    "message": {
      "type": "string",
      "title": "Message",
      "description": "Human-readable status message",
      "default": "success"
    },
    "data": {
      "anyOf": [
        {
          "$ref": "#/$defs/BiorhythmSingleDayResponse"
        },
        {
          "$ref": "#/$defs/BiorhythmRangeResponse"
        }
      ],
      "title": "Data",
      "description": "The endpoint response payload"
    }
  },
  "type": "object",
  "required": [
    "data"
  ],
  "$defs": {
    "BiorhythmCycleDetail": {
      "properties": {
        "value": {
          "type": "number",
          "title": "Value",
          "description": "Cycle value from -1.0 to +1.0"
        },
        "percentage": {
          "type": "number",
          "title": "Percentage",
          "description": "Cycle value as percentage"
        },
        "phase": {
          "type": "string",
          "title": "Phase",
          "description": "Phase label: High (value above +0.5), Low (below -0.5), otherwise Rising or Falling by the direction the curve is moving that day (see trend)."
        },
        "trend": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trend",
          "description": "Direction of the curve that day, from the slope of the sine: rising, falling, or turning (exactly at a peak or trough)."
        },
        "is_critical": {
          "type": "boolean",
          "title": "Is Critical",
          "description": "True when the cycle crosses zero"
        },
        "cycle_length_days": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cycle Length Days",
          "description": "Cycle length in days (present on single-day responses)"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description",
          "description": "Cycle description (present on single-day responses)"
        }
      },
      "type": "object",
      "required": [
        "value",
        "percentage",
        "phase",
        "is_critical"
      ],
      "title": "BiorhythmCycleDetail"
    },
    "BiorhythmDailyEntry": {
      "properties": {
        "date": {
          "type": "string",
          "title": "Date"
        },
        "cycles": {
          "additionalProperties": {
            "$ref": "#/$defs/BiorhythmCycleDetail"
          },
          "type": "object",
          "title": "Cycles"
        },
        "critical": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Critical"
        },
        "composite_score": {
          "type": "number",
          "title": "Composite Score"
        }
      },
      "type": "object",
      "required": [
        "date",
        "cycles",
        "critical",
        "composite_score"
      ],
      "title": "BiorhythmDailyEntry"
    },
    "BiorhythmRangeResponse": {
      "properties": {
        "birth_date": {
          "type": "string",
          "title": "Birth Date"
        },
        "start_date": {
          "type": "string",
          "title": "Start Date"
        },
        "end_date": {
          "type": "string",
          "title": "End Date"
        },
        "days": {
          "type": "integer",
          "title": "Days"
        },
        "daily": {
          "items": {
            "$ref": "#/$defs/BiorhythmDailyEntry"
          },
          "type": "array",
          "title": "Daily"
        },
        "note": {
          "type": "string",
          "title": "Note"
        }
      },
      "type": "object",
      "required": [
        "birth_date",
        "start_date",
        "end_date",
        "days",
        "daily",
        "note"
      ],
      "title": "BiorhythmRangeResponse"
    },
    "BiorhythmSingleDayResponse": {
      "properties": {
        "birth_date": {
          "type": "string",
          "title": "Birth Date"
        },
        "target_date": {
          "type": "string",
          "title": "Target Date"
        },
        "days_since_birth": {
          "type": "integer",
          "title": "Days Since Birth"
        },
        "cycles": {
          "additionalProperties": {
            "$ref": "#/$defs/BiorhythmCycleDetail"
          },
          "type": "object",
          "title": "Cycles"
        },
        "critical_today": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Critical Today"
        },
        "has_critical_day": {
          "type": "boolean",
          "title": "Has Critical Day"
        },
        "composite_score": {
          "type": "number",
          "title": "Composite Score"
        },
        "note": {
          "type": "string",
          "title": "Note"
        }
      },
      "type": "object",
      "required": [
        "birth_date",
        "target_date",
        "days_since_birth",
        "cycles",
        "critical_today",
        "has_critical_day",
        "composite_score",
        "note"
      ],
      "title": "BiorhythmSingleDayResponse"
    }
  }
}