This work was completed during my time at the Stellar Development Foundation in 2022–2023.
50+ parameters
Shared parameter definitions, defined once and referenced across every endpoint.
30+ schemas
Reusable schema objects covering accounts, transactions, ledgers, and more.
40+ endpoints
Full coverage across both the Horizon API and the Anchor Platform.
30+ examples
Concrete request and response examples wired directly into endpoint definitions.
Context
Stellar is a decentralized payment network built for fast, low-cost cross-border transactions. Horizon is Stellar’s REST API — the primary interface for querying accounts, submitting transactions, and streaming ledger data. The Anchor Platform handles the bridge between Stellar and traditional finance, managing KYC, deposits, withdrawals, and compliance. Both APIs serve developers building on Stellar. Both needed documentation that could scale.The approach
There was no existing spec to work from — everything had to be derived.Read the codebase
The starting point was understanding what the APIs actually did, not what the old docs claimed. That meant reading source code, tracing request handlers, and mapping response shapes directly.
Review existing documentation
The existing docs were a useful signal — not for accuracy, but for identifying gaps, inconsistencies, and areas where engineers had clearly stopped maintaining them.
Interview senior engineers
Codebase reading can only go so far. I sat down with engineers to clarify intent, surface edge cases, and document behavior that had never been written down.
Design a modular file structure
Rather than a single monolithic spec file, I designed a structure where components are defined once and referenced everywhere using
$ref. Parameters, schemas, and examples all live in dedicated files.File structure
The spec is split across purpose-specific files. Nothing is defined more than once.How it works
Shared parameters
Pagination and ordering parameters are defined once inparameters.yml and shared across all list endpoints.
parameters.yml
Endpoint definitions
Endpoints compose shared components via$ref rather than repeating definitions inline.
endpoints/accounts.yml
$ref:
endpoints/accounts.yml (list endpoint)
The outcome
The specifications now power the Stellar API documentation, auto-generated through Docusaurus. The full spec lives in thestellar-docs repo on GitHub.
| Property | Result |
|---|---|
| Single source of truth | The spec is the contract — docs and implementation stay in sync |
| Update once, propagate everywhere | Change CursorParam and every endpoint using it reflects the change |
| Docs that can’t drift | Generated from the spec, so always in sync with what the API actually does |
| Reduced maintenance burden | Adding a new endpoint means composing existing components, not rewriting definitions |
Beyond documentation
A formal OpenAPI definition isn’t just documentation — it’s infrastructure.SDK generation
Auto-generate client libraries in Python, JavaScript, Go, and other languages directly from the spec.
Mock servers
Spin up fake APIs for frontend development before the backend is ready.
Contract testing
Validate that the live implementation matches what the spec promises.
Postman collections
Auto-import all endpoints for manual testing without writing collection entries by hand.
Changelog diffing
Compare spec versions to see exactly what changed between releases.
Multi-team alignment
A shared spec gives frontend, backend, and docs teams a single reference to work from.
