Skip to content

feat: generate error and warning documentation in the Mintlify API reference#1209

Open
dawnho wants to merge 7 commits into
mainfrom
feat/mintlify-errors-warnings-pages
Open

feat: generate error and warning documentation in the Mintlify API reference#1209
dawnho wants to merge 7 commits into
mainfrom
feat/mintlify-errors-warnings-pages

Conversation

@dawnho

@dawnho dawnho commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

Restores enumerated error and warning documentation to the Mintlify API reference, mirroring the events-documentation pattern from #1204.

Errors and warnings are enumerated states Seam reports on a resource (e.g. device.errors[].error_code = "device_offline"), each with a description. The blueprint models them as discriminated-list properties, but the OpenAPI spec can only express the generic errors/warnings array shape — so the enumerated codes and their meanings were dropped in the GitBook→Mintlify migration. This is the same gap events had before #1204.

What's included

  • New module mintlify-codegen/errors.ts (updateErrorPages): walks blueprint.resources, extracts the errors/warnings discriminated lists (code = discriminator enum value, prose = variant description), groups by variant group, and writes one combined errors.mdx per resource with ## Errors and ## Warnings sections.
  • Nav wiring in update-nav.ts: adds isErrorsPage (so pages survive nav rebuilds), generalizes insertAfterObjectPageinsertAfterPage + insertIntoGroups, and adds insertErrorPagesIntoNav anchoring each page after its events page (sidebar reads object → events → errors).
  • Pipeline hook in generate.ts: Phase F.7, after events and before link canonicalization (so legacy docs.seam.co links in descriptions get rewritten).
  • 13 generated pages: devices, access_codes (+ unmanaged), access_grants, access_methods, acs/{systems, users, credentials, entrances, access_groups}, connected_accounts, devices/unmanaged, user_identities.

Resources with error data but no object page (bridge_client_session and three unmanaged ACS variants) are skipped with a log line — matching events behavior.

Test plan

  • npm run typecheck, npm run lint, npm run format all pass
  • npm run generate:mintlify regenerates deterministically (13 pages; output stable across the code-simplify refactor)
  • Verified /api/devices/errors renders in the Mintlify dev server: grouped sub-headings appear in the on-page TOC and description links resolve

🤖 Generated with Claude Code

…ference

Restore enumerated error/warning docs to the Mintlify API reference as one
combined page per resource, mirroring the events-documentation pattern from
#1204. Errors and warnings are discriminated-list properties on each resource
that the OpenAPI spec can't express, so they were dropped in the GitBook to
Mintlify migration.

Adds mintlify-codegen/errors.ts (updateErrorPages), wires the pages into the
sidebar via update-nav.ts (after the events page), and hooks it into generate.ts
as Phase F.7, before link canonicalization. Generates 13 pages.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dawnho dawnho requested a review from a team as a code owner July 1, 2026 21:51
@mintlify

mintlify Bot commented Jul 1, 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 1, 2026, 10:06 PM

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

Open each Errors/Warnings section with the object shape — an example
payload plus a properties accordion (error_code/warning_code, message,
created_at, and the classification flags like is_device_error) — above
the existing code list, mirroring how the events pages document payloads.

Extract the shared property-rendering helpers (formatType, sampleValue,
indent, hasEnumValues) into property-fields.ts, now used by both events.ts
and errors.ts. Verified the events pages regenerate byte-identical.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Each error/warning code is now a heading (### for ungrouped codes, ####
for codes nested under a variant-group heading) instead of bold text, so
every code gets a stable, linkable anchor. Drops the --- separators the
headings replace.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Separate each code (heading + description) with a horizontal rule so the
long lists are easier to scan, restoring the divider rhythm from the
original GitBook layout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The example payload's `message` was populated from the doc description,
which contains Markdown links that render as literal syntax inside a JSON
code block. Strip link/inline-code Markdown to plain text (and fall back
to a placeholder when the description is empty) so the example reads like
a real API message. The code entry descriptions keep their Markdown links.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wrap each section's example payload in <ResponseExample> so it renders in
the right-hand sticky column, matching the object pages' two-column layout.
The intro, properties accordion, and code list flow in the left column.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants