Skip to content

fix(sat): unify Campaign/CampaignSummary status into a shared enum schema - #63

Open
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-5kjiwm
Open

fix(sat): unify Campaign/CampaignSummary status into a shared enum schema#63
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-5kjiwm

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

Summary

  • sat/openapi.yaml's CampaignSummary.status field is a validated enum (Created, Queued, In progress, Emails Sent, Completed, Draft, In Review, Approved), but the identical conceptual field on Campaign (the schema returned by getCampaign/listCampaigns) was a plain, untyped string — no enum at all.
  • The approval-workflow endpoints (submit-review, approve, reject) confirm Draft/In Review/Approved are real states shared across both representations, so this was a real modeling gap, not an intentional difference: a client hitting the full-detail getCampaign endpoint got no schema-level validation or generated typing for status, while the same value via the summary endpoint did.
  • Since the README frames these specs as a source for generated SDKs/MCP tool definitions, this asymmetry meant generated typings for "campaign status" would differ depending on which endpoint the value came from.

Fix: factored the enum into a new shared CampaignStatus component schema and pointed both Campaign.status and CampaignSummary.status at it via $ref.

Pre-flight duplicate check

Related issues/PRs

None — no existing open issue or PR touches Campaign/CampaignSummary status modeling.

Testing

  • spectral lint sat/openapi.yaml --ruleset .spectral.yaml --fail-severity error → 0 errors (same 8 pre-accepted trailing-slash warnings as before).
  • python3 -c "import yaml; yaml.safe_load(open('sat/openapi.yaml'))" → parses cleanly.

Generated by Claude Code

Campaign.status was an untyped free-form string while the identical
conceptual field on CampaignSummary carried the real enum
(Created/Queued/In progress/Emails Sent/Completed/Draft/In Review/Approved).
Callers of getCampaign/listCampaigns got no schema-level validation or
generated typing for status, unlike callers of the summary endpoints,
even though both surface the same underlying value. Factor the enum out
into a shared CampaignStatus schema referenced by both.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015NduBfA4wkj37PDwy343fc
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