Repository navigation
Conversation
The CLI was hardwired to Health API v4, so new features that ship on v4beta first (starting with skin temperature) were unreachable, and GHEALTH_BASE_URL alone left `schema` reading the v4 discovery doc. The active version now resolves from --api-version, GHEALTH_API_VERSION, the profile's api_version, then v4 (unchanged default). The base URL, discovery doc, discovery cache file and `schema` endpoint paths all follow it. GHEALTH_BASE_URL still wins for the URL; when it ends in a known version that version becomes the active channel, and a conflicting explicit choice is rejected. Gating is generic so upcoming beta types and commands need no extra plumbing: data types carry a Channel (with optional per-operation overrides), and any other command can opt in with a Cobra "channel" annotation. Beta-only items stay discoverable on v4, marked [beta] in help and `schema`, and fail with a validation error that hints at --api-version v4beta. An unknown `ghealth data <type>` is now a validation error instead of printing help with exit 0. JSON data responses carry `_api_version` and `auth status` reports the resolved version, its source and the base URL, so agents can tell which channel answered. No data types are added here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CLI was hardwired to Health API v4, so new features that ship on the new v4beta channel first (starting with skin temperature) were unreachable, and GHEALTH_BASE_URL alone left
schemareading the v4 discovery doc.The active version now resolves from --api-version, GHEALTH_API_VERSION, the profile's api_version, then v4 (unchanged default). The base URL, discovery doc, discovery cache file and
schemaendpoint paths all follow it.Gating is generic so upcoming beta types and commands need no extra plumbing: data types carry a Channel (with optional per-operation overrides), and any other command can opt in with a Cobra "channel" annotation. Beta-only items stay discoverable on v4, marked [beta] in help and
schema, and fail with a validation error that hints at --api-version v4beta. An unknownghealth data <type>is now a validation error instead of printing help with exit 0.JSON data responses carry
_api_versionandauth statusreports the resolved version, its source and the base URL, so agents can tell which channel answered.