docs/proposals-accepted/202107-protobuf-openapi-httpapi.md
This design doc is proposing a design for Thanos HTTP API defined in protobuf and OpenAPI.
To improve Thanos usage for users, we would like to define our HTTP APIs in protobuf/OpenAPI and expose those in the repository. OpenAPI is a language for describing REST APIs with a widely-used tooling ecosystem. With OpenAPI, developers can generate live documentation, validate APIs and even generate client and server stubs from OpenAPI to use our APIs efficiently. Also, the auto-generated documentation problem prevent documentation errors (Prometheus#7192, Prometheus#5567). Protocol Buffers (a.k.a., protobuf) is well-known as a mechanism for serializing structured data, and it's usually used to define gRPC APIs. Also, protobuf specification could be used to define REST API. We hope to use protobuf to define our APIs for consistency, while we also want to leverage the tooling ecosystem of OpenAPI.
So, we want to define REST APIs in protobuf, generate OpenAPI definition from protobuf with gnostic. This would allow users to use tools for documentation, validation, type checking, and even interface code generation to use our APIs efficiently.
Similarly, we want to reuse this work in Prometheus.
Pros:
Cons: