Skip to content

Adopt axum + OpenAPI/Swagger for API documentation #71

@jdhoffa

Description

@jdhoffa

Summary

Migrate the current HTTP API implementation to an ecosystem-idiomatic Rust stack using axum for routing and utoipa + utoipa-swagger-ui for OpenAPI and Swagger docs.

Motivation

  • Keep API implementation aligned with common Rust ecosystem patterns.
  • Provide self-documenting API contracts for frontend and external consumers.
  • Make endpoint behavior and schemas easier to validate and evolve.

Proposed scope

  • Replace custom HTTP server with axum.
  • Generate OpenAPI spec from Rust types/handlers using utoipa.
  • Serve docs endpoints:
    • GET /openapi.json
    • GET /docs (Swagger UI)
  • Preserve existing API behavior:
    • GET /state
    • GET /telemetry?from=&to=
  • Keep telemetry schema v1 field names unchanged.

Acceptance criteria

  • API server runs with --api-bind as before.
  • /openapi.json returns valid OpenAPI JSON.
  • /docs serves Swagger UI successfully.
  • Existing integration coverage continues to pass for /state and /telemetry.
  • Add/adjust integration tests to validate docs endpoint availability.
  • README documents docs endpoints and usage.

Notes

This is intentionally deferred work; issue is for backlog prioritization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions