Skip to content

feat: honor paths.yaml include_groups in generated error pages#1220

Closed
dawnho wants to merge 1 commit into
mainfrom
claude/error-pages-include-groups-parity
Closed

feat: honor paths.yaml include_groups in generated error pages#1220
dawnho wants to merge 1 commit into
mainfrom
claude/error-pages-include-groups-parity

Conversation

@dawnho

@dawnho dawnho commented Jul 2, 2026

Copy link
Copy Markdown
Member

Background

Follow-up to #1219 (merged), which added Errors and Warnings pages for device sub-categories. This PR makes the generated error pages honor the include_groups filter in codegen/data/paths.yaml, which the Mintlify generator ignored — causing two kinds of divergence from the old GitBook API reference.

Problem

1. Device sub-category pages were too thin. GitBook showed universal (ungrouped) device codes + the type's configured groups; the generator showed only the type's own group.

Page Merged (#1219) Old GitBook This PR
/thermostats 2 23 23
/locks 10 39 39

The thermostat page omitted device_offline, account_disconnected, hub_disconnected — the errors a thermostat actually reports most often.

2. Resource pages with a filter over-included. /access_codes and /access_codes/unmanaged have include_groups: [locks, access_codes], but the generator emitted every group — surfacing a stray thermostats-group code, auxiliary_heat_running ("auxiliary heat is running"), on the access-code error pages. GitBook excluded it.

Fix

paths.yaml is already loaded by the Mintlify pipeline as pathMetadata, so this drives the exact same config via one rule mirroring the legacy groupVariants (codegen/lib/layout/api-route.ts):

include_groups set → keep universal codes + listed groups, flattened into one code-sorted list. unset → keep every group with its subheading.

Applied to:

  • /locks → universal + locks + access_codes (10 → 39)
  • /thermostats → universal + thermostats (2 → 23)
  • /access_codes, /access_codes/unmanaged → drop the stray auxiliary_heat_running and flatten (now 35 codes each, matching GitBook exactly)
  • /phones → unchanged (its own group's warning; no include_groups upstream, and a phone is a distinct concept from a lock/thermostat device)

Generated code sets now match the GitBook pages exactly (verified per page). Resources without a filter (devices, acs/*, connected_accounts, …) are unchanged.

Verification

  • npm run typecheck + scoped eslint/prettier --check pass.
  • npm run generate:mintlify is idempotent; the only excluded side effect is openapi.json code-sample reformatting (missing ruff/shfmt/stree formatters), unrelated to this change.
  • 7 files: the generator (errors.ts), generate.ts, load-data.ts (path-metadata type), and 4 regenerated pages (locks, thermostats, access_codes, access_codes/unmanaged).

🤖 Generated with Claude Code

@dawnho dawnho requested a review from a team as a code owner July 2, 2026 18:56
@mintlify

mintlify Bot commented Jul 2, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
seam 🟢 Ready View Preview Jul 2, 2026, 7:19 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

The Mintlify error/warning page generator ignored the `include_groups` filter
in codegen/data/paths.yaml, so its pages diverged from the GitBook API
reference in two ways:

  - Device sub-category pages (locks, thermostats) had no page of their own, or
    once added listed only each type's specific variant group. GitBook showed
    the universal (ungrouped) device codes plus the type's configured groups —
    e.g. thermostats had 23 codes (device_offline, account_disconnected, …), not
    just the 2 thermostat-specific ones; locks had 39, not 10.
  - Resource pages that DO have a filter (access_codes, access_codes/unmanaged)
    over-included: they showed every group, surfacing a stray `thermostats`
    group code (`auxiliary_heat_running`) that GitBook excluded.

paths.yaml is already loaded by the Mintlify pipeline as pathMetadata, so this
drives the exact same config via one rule mirroring the legacy groupVariants:
include_groups set → keep universal codes + listed groups, flattened into one
code-sorted list; unset → keep every group with its subheading.

Applied to:
  - /locks       → universal + locks + access_codes groups (10 → 39)
  - /thermostats → universal + thermostats group (2 → 23)
  - /access_codes, /access_codes/unmanaged → drop the stray thermostats code
    and flatten (now match GitBook exactly, 35 codes each)
  - /phones      → unchanged (its own group's warning; no include_groups
                   upstream, and a phone is distinct from a lock/thermostat)

Generated code sets now match the GitBook pages exactly. Resources without a
filter (devices, acs/*, connected_accounts, …) are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dawnho dawnho force-pushed the claude/error-pages-include-groups-parity branch from 4b6e099 to 2ce61be Compare July 2, 2026 19:26
@dawnho dawnho changed the title feat: show universal device codes on lock and thermostat error pages feat: honor paths.yaml include_groups in generated error pages Jul 2, 2026
@dawnho dawnho closed this Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant