[GG-1690] Migrate REST docs to OpenAPI spec + Slate generator#124
Open
dgra wants to merge 1 commit into
Open
Conversation
Make OpenAPI 3.1 the source of truth for the REST API docs. Redoc renders the aggregator spec/rest-v2.yaml; a custom stdlib-only Ruby generator (lib/openapi_slate.rb, via script/generate-docs) reproduces the existing Slate _*.md partials so the public site stays the same. Structure: - spec/rest-v2.yaml: aggregator ($refs every path, in display order) - spec/components.yaml: shared parameters/responses/schemas/securitySchemes - spec/fragments/<resource>.yaml: one self-contained file per resource Presentation that can't be derived from OpenAPI lives under the x-slate vendor extension (Redoc ignores it). script/verify-docs gates on a normalized diff and reports byte diffs; see spec/README.md for the workflow and x-slate reference. All 14 REST resources generate from the spec (verify-docs: 0 pending). The smaller resources reproduce byte-identical; the larger pages (subscribers, campaigns, workflows, broadcasts, batch_api) are regenerated as canonical output (full response JSON, schema-derived tables). Note: the Batch API page's three v3 Shopper Activity batch endpoints are carried verbatim in batch_api.yaml x-slate.footer; they should later move to a dedicated shopper-activity spec. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
atongen
approved these changes
Jun 16, 2026
atongen
left a comment
Member
There was a problem hiding this comment.
I'm not sure I can fully review this, the parts I looked at looked good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Makes OpenAPI 3.1 the source of truth for the REST API docs, while keeping the public Slate site (developer.drip.com) unchanged. Redoc renders the aggregator
spec/rest-v2.yaml; a custom stdlib-only Ruby generator (lib/openapi_slate.rb, viascript/generate-docs) reproduces the existingsource/includes/rest/_*.mdpartials.Stacked on
GG-1690_sec_api(the Single-Email Campaign write-API doc) since the broadcasts fragment builds on it — so this PR's diff is just the migration.Structure
spec/rest-v2.yaml— aggregator ($refs every path, in display order)spec/components.yaml— shared parameters / responses / schemas / securitySchemesspec/fragments/<resource>.yaml— one self-contained file per resourcex-slatevendor extension (Redoc ignores it)Workflow
verify-docsgates on a normalized diff and reports byte diffs;redocly lintpasses. Seespec/README.mdfor the full workflow andx-slatereference.Status
All 14 REST resources generate from the spec (
verify-docs: 0 pending). Smaller resources reproduce byte-identical; the larger pages (subscribers,campaigns,workflows,broadcasts,batch_api) are regenerated as canonical output (full response JSON instead of{ ... }placeholders, schema-derived tables).Follow-up
The Batch API page's three v3 Shopper Activity batch endpoints (cart/order/product) aren't part of
rest-v2; they're carried verbatim inbatch_api.yamlx-slate.footerfor now and should later move to a dedicated shopper-activity spec.🤖 Generated with Claude Code