Skip to content

docs: add OpenAPI definition for the sequencer HTTP API - #50

Open
tuler wants to merge 1 commit into
mainfrom
feature/openapi
Open

tuler wants to merge 1 commit into
mainfrom
feature/openapi

Conversation

@tuler

@tuler tuler commented Oct 1, 2026

Copy link
Copy Markdown
Member

What changed

Adds openapi.yaml at the repo root: an OpenAPI 3.1 definition of the 14 routes the sequencer serves, derived from the Axum handlers and serde wire types and cross-checked against the README API section.

  • ingress (public): POST /tx, GET /fee, GET /nonce, GET /domain
  • history (internal): GET /ws/subscribe, GET /history, GET /historical-l1-inputs
  • snapshots (internal): GET /finalized_state/inclusion_block, GET /finalized_state, GET /latest_snapshot, GET /finalized_snapshot
  • health (internal): GET /livez, GET /readyz, GET /healthz

No code or behavior changes.

Why

A machine-readable description of the API for client generation, documentation tooling, and app developers integrating against the sequencer.

Risk / compatibility notes

  • Second copy of the contract. The README API section remains the owner; the spec says so in its description. Nothing links to the file or checks it in CI yet, so it will drift unless kept in sync.
  • Not linted. The YAML parses and every $ref resolves, but it has not been run through an OpenAPI linter (e.g. Redocly or Spectral).
  • WebSocket frames. OpenAPI cannot describe messages after the upgrade. /ws/subscribe documents the handshake and its refusals; the frame shape is the BroadcastTxMessage schema, referenced through a non-standard x-websocket-messages extension.
  • Non-JSON errors are modelled as such. /ws/subscribe returns a plain-text 400 for bad query fields, and the snapshot routes return empty-body 404/500, rather than the {ok, code, message} shape.
  • u64 fields are typed integer with the full u64 maximum, which exceeds strict format: int64; some generators may complain or pick a signed type.

🤖 Generated with Claude Code

@tuler
tuler requested a review from GCdePaula October 1, 2026 19:02
@tuler
tuler marked this pull request as ready for review October 1, 2026 19:02
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