Skip to content

docs(events): Shadow Update fields nullable + promote auto-gen schema files#2

Open
spk-ai wants to merge 2 commits into
mainfrom
docs/aa-94-shadow-nullable-and-schema-endpoint
Open

docs(events): Shadow Update fields nullable + promote auto-gen schema files#2
spk-ai wants to merge 2 commits into
mainfrom
docs/aa-94-shadow-nullable-and-schema-endpoint

Conversation

@spk-ai
Copy link
Copy Markdown
Collaborator

@spk-ai spk-ai commented May 14, 2026

Summary

Two partner-facing docs catch up to recent b2c-api work:

  1. events-catalog.mdx Shadow Update nullability — real AWS payloads have null in desiredState/reportedState/metadata/version fields the doc typed as string/number. Partners writing typed handlers would trip on this (the b2c-api Zod schema was relaxed today in PR #129 / SPK-API-V resolved). Updated field types + added explicit "plan for null" guidance.

  2. events-webhooks.mdx Schema & Code Generation — replaced the stale eventbridge-schemas.yaml section with one promoting the auto-regenerated event-schemas.json + command-schemas.json files (already in this repo, refreshed by b2c-api CI on every deploy). Added paste-ready codegen recipes for Pydantic v2, TypeScript, and quicktype (any-language).

Out of scope (separate work)

  • The legacy eventbridge-schemas.yaml file (Mar 25) still references the deprecated customer.events source. Not edited here — the new auto-generated files supersede it and the new docs section directs partners away from it.
  • openapi.yaml is regenerated by b2c-api CI; not touched.
  • The CF api.spkey.co/schemas/events.json 403 (CNAME cross-user, error 1014) is a CDN/DNS configuration issue, unrelated.

Test plan

  • Mintlify preview renders both pages cleanly
  • Markdown table syntax for string\|null (escaped pipe) renders correctly

… files

Two related fixes after the recent b2c-api work:

1. **events-catalog.mdx — Shadow Update nullability.** Real AWS-delivered
   `spk.iot.shadow@Shadow Update` events have `null` in fields the doc
   previously typed as `string`. The b2c-api Zod schema was relaxed today
   to match reality (PR #129 — SPK-API-V). Partner-facing types updated:

   - `desiredState`: string → string\|null (null when no desired state set;
     observed in ~50% of real events)
   - `reportedState`: string → string\|null (null for never-reported)
   - `metadata`: string → string\|null
   - `version`: number → number\|null (null on first event)
   - `partnerId`: already string\|null (no change)

   Added explicit guidance: only `thingName` and `deltaState` are
   guaranteed non-null; plan for null on every other field.

2. **events-webhooks.mdx — Schema & Code Generation section rewritten.**
   The old section pointed at `eventbridge-schemas.yaml` with a "lags the
   catalog" caveat. The repo now has TWO auto-generated JSON Schema files
   regenerated on every b2c-api deploy:

   - `event-schemas.json` ← `GET /schemas/events.json`
   - `command-schemas.json` ← `GET /schemas/commands.json`

   Both carry a `version` field (worker git SHA) for staleness detection.
   Added paste-ready recipes for Pydantic v2, TypeScript, and any-language
   via quicktype. Also called out that the Shadow Update envelope lives in
   the catalog page (separate shape from spk.api events) and that the
   API Reference tab covers the full OpenAPI surface.

No content change to event-type lists or other partner-facing docs — those
were refreshed last week and remain accurate.
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

CI publishDocs step keeps getting cancelled by sibling test() failure
(3dEye 429 rate-limit in camera-role acceptance tests). The deployed
b2c-api worker (version 32d654a1, nonprod) has the correct OpenAPI
including /cameras/my and /cameras/{id}/stream and updated CreateCameraRole
schema — but docs repo was 5 days stale.

Synced manually with the same jq sanitization + yq YAML conversion
publishDocs does. Will roll back to CI-driven once acceptance flakiness
is sorted.

Co-Authored-By: Claude Opus 4.7 (1M context) <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.

1 participant