17 lines
555 B
C++
17 lines
555 B
C++
// Routes: GET /openapi.json and GET /docs
|
|||
|
|
#include "support/Assert.hpp"
|
||
|
|
|
||
|
|
using namespace molo::example::test;
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
Fixture f;
|
||
|
|
auto spec = f.client->get("/openapi.json");
|
||
|
|
check(spec.status == 200, "spec status 200");
|
||
|
|
check(contains(spec.body, "\"openapi\":\"3.0.0\""), "openapi version");
|
||
|
|
check(contains(spec.body, "/health"), "health path listed");
|
||
|
|
auto docs = f.client->get("/docs");
|
||
|
|
check(docs.status == 200, "docs status 200");
|
||
|
|
check(contains(docs.body, "/openapi.json"), "docs link spec");
|
||
|
|
return finish("openapi/docs");
|
||
|
|
}
|