Skip to content

feat(api): add OpenAPI 3.1 spec with Swagger UI at /docs#91

Merged
Siddhant-K-code merged 1 commit into
mainfrom
feat/openapi-spec
May 9, 2026
Merged

feat(api): add OpenAPI 3.1 spec with Swagger UI at /docs#91
Siddhant-K-code merged 1 commit into
mainfrom
feat/openapi-spec

Conversation

@Siddhant-K-code

Copy link
Copy Markdown
Owner

What

Adds a complete OpenAPI 3.1 specification for the Distill API and serves interactive Swagger UI documentation at /docs.

Why

No machine-readable API description existed. This blocks SDK generation, makes integration harder, and means every consumer has to read source code to understand the API.

Changes

  • openapi.yaml — full OpenAPI 3.1 spec covering all endpoints:
    • Dedupe (/v1/dedupe, /v1/dedupe/stream)
    • Pipeline (/v1/pipeline)
    • Batch (/v1/batch, /v1/batch/{job_id}, /v1/batch/{job_id}/results)
    • Memory (store, recall, forget, expire, supersede, stats)
    • Sessions (create, push, context, get, delete)
    • Health (/health, /metrics)
  • GET /docs — Swagger UI served via CDN (zero dependencies)
  • GET /openapi.yaml — raw spec with CORS headers
  • Root endpoint updated with /docs link and complete endpoint list
  • Spec embedded in binary via //go:embed

Usage

# Start the server
distill api

# Open docs in browser
open http://localhost:8080/docs

# Fetch raw spec for SDK generation
curl http://localhost:8080/openapi.yaml > openapi.yaml

Closes #23

- OpenAPI 3.1 spec covering all endpoints: dedupe, pipeline, batch,
  memory (store/recall/forget/expire/supersede/stats), sessions, health
- Swagger UI served at /docs via CDN (no dependencies)
- Raw spec available at /openapi.yaml
- Spec also at repo root for discoverability
- Root endpoint updated with docs link and full endpoint list

Closes #23

Co-authored-by: Ona <no-reply@ona.com>
@Siddhant-K-code Siddhant-K-code added documentation Improvements or additions to documentation enhancement New feature or request labels May 9, 2026
@Siddhant-K-code Siddhant-K-code merged commit 6cd87aa into main May 9, 2026
2 checks passed
@Siddhant-K-code Siddhant-K-code deleted the feat/openapi-spec branch May 9, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] OpenAPI specification and auto-generated docs

1 participant