Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
agent: introduce status HTTP API and OpenAPI docs
Adds the first public HTTP endpoint to agent, for fetching the status for a list of live specs. This includes some boilerplate for generating an OpenAPI spec from our axum handlers, and API docs that are rendered from that spec using Scalar. I tried to establish some repeatable patterns for writing API handlers with generated documentation and consistent error handling. The objective was to make it pretty straight forward to add more endpoints. Part of this was introducing a separation between the "public" APIs that we wish to make available to all clients, and the private APIs for which we don't want to guarantee backward compatibility. The idea is to only add apis to the `public` module when we want to support it for use by end users (which implies at least some level of backward compatibility). Only the public APIs are covered by the OpenAPI spec. The `aide` crate is used for generating the OpenAPI spec. It's not _great_, but seems to be better than the alternative, `utoipa`, which requires macros for defining routes and isn't directly compatible with `schemars`.
- Loading branch information