1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-07 17:03:01 +03:00

Host a Swagger UI both in the static documentation and by the server

This commit is contained in:
Quentin Gliech
2024-07-26 17:09:42 +02:00
parent 70222eeb19
commit 3f947025e2
16 changed files with 2713 additions and 106 deletions

View File

@@ -870,3 +870,24 @@ pub struct GraphQLPlayground;
impl SimpleRoute for GraphQLPlayground {
const PATH: &'static str = "/graphql/playground";
}
/// `GET /api/spec.json`
pub struct ApiSpec;
impl SimpleRoute for ApiSpec {
const PATH: &'static str = "/api/spec.json";
}
/// `GET /api/doc/`
pub struct ApiDoc;
impl SimpleRoute for ApiDoc {
const PATH: &'static str = "/api/doc/";
}
/// `GET /api/doc/oauth2-callback`
pub struct ApiDocCallback;
impl SimpleRoute for ApiDocCallback {
const PATH: &'static str = "/api/doc/oauth2-callback";
}

View File

@@ -28,7 +28,9 @@ pub struct UrlBuilder {
}
impl UrlBuilder {
fn absolute_url_for<U>(&self, destination: &U) -> Url
/// Create an absolute URL for a route
#[must_use]
pub fn absolute_url_for<U>(&self, destination: &U) -> Url
where
U: Route,
{