1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-04-20 23:07:01 +00:00

add some tests for OpenapiBuilder

This commit is contained in:
Dominic 2020-05-03 19:17:55 +02:00
parent 101e94b900
commit f7157dcf62
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
4 changed files with 82 additions and 11 deletions

View file

@ -134,7 +134,12 @@ fn main()
);
gotham::start(ADDR, build_router(chain, pipelines, |route| {
route.with_openapi("Users Example".to_owned(), "0.0.1".to_owned(), format!("http://{}", ADDR), |mut route| {
let info = OpenapiInfo {
title: "Users Example".to_owned(),
version: "0.0.1".to_owned(),
urls: vec![format!("http://{}", ADDR)]
};
route.with_openapi(info, |mut route| {
route.resource::<Users>("users");
route.resource::<Auth>("auth");
route.get_openapi("openapi");