Skip to content

chore: refresh OpenAPI spec + accept optional managedBy#21

Merged
caballeto merged 1 commit into
mainfrom
chore/spec-sync-managedby-currentstatus
May 6, 2026
Merged

chore: refresh OpenAPI spec + accept optional managedBy#21
caballeto merged 1 commit into
mainfrom
chore/spec-sync-managedby-currentstatus

Conversation

@caballeto
Copy link
Copy Markdown
Member

Summary

Mirrors sdk-python#26. After mono#369 merged, spec_updated was dispatched and the JS SDK's spec-check ran red because:

  1. The bundled spec was stale (missing managedBy on ResourceGroupDto / StatusPageDto / AlertChannelDto, missing currentStatus on MonitorDto).
  2. CreateMonitorRequest.managedBy flipped from required → optional, so test/negative-validation.test.ts > rejects missing managedBy started failing (the server now defaults to API or to the surface-injected value).

This PR:

  • Refreshes docs/openapi/monitoring-api.json from the production spec.
  • Regenerates src/generated/api.ts.
  • Flips the negative test to accepts missing managedBy (server defaults to API).

Why managedBy is now optional

Forcing every caller to set managedBy was friction we couldn't justify — the API can derive it from the auth context (API for raw API tokens, CLI / TERRAFORM / MCP when surface clients inject it). Default behaviour is unchanged for callers who do set it.

Test plan

  • npm test → 1321/1321 pass
  • npm run lint clean
  • npm run typecheck clean

Made with Cursor

mono#369 made managedBy optional on CreateMonitorRequest (server defaults
to "API" / surface-injected value), added managedBy to RG/StatusPage/
AlertChannel responses, and added MonitorDto.currentStatus.

- regen src/generated/api.ts from fresh spec
- flip "rejects missing managedBy" -> "accepts missing managedBy" to
  match the new contract (sdk-python#26 made the same change)

Fixes the spec-check failure that fired on the spec_updated dispatch
after mono#369 was merged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@caballeto caballeto merged commit 6d1b6fa into main May 6, 2026
3 checks passed
@caballeto caballeto deleted the chore/spec-sync-managedby-currentstatus branch May 6, 2026 14:08
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