Skip to content
Clone
2aef8d4
90 lines 2.9 KB Rust
use utoipa::OpenApi;
use crate::features::post;
use crate::features::post_label;
use crate::features::post_mention;
use crate::features::post_reaction;
use crate::features::post_reply;
use crate::features::post_watch;
use crate::features::posts;
#[derive(OpenApi)]
#[openapi(
info(
title = "lib/post",
version = env!("CARGO_PKG_VERSION"),
description = "Post discussion service (board / post / reply / reaction / mention / watch / label)",
),
paths(
crate::handler::posts::create::handler,
crate::handler::posts::list::handler,
crate::handler::post::create::handler,
crate::handler::post::get::handler,
crate::handler::post::update::handler,
crate::handler::post::delete::handler,
crate::handler::post::close::handler,
crate::handler::post::reopen::handler,
crate::handler::post::archive::handler,
crate::handler::post_reply::create::handler,
crate::handler::post_reply::list::handler,
crate::handler::post_reaction::create::handler,
crate::handler::post_reaction::list::handler,
crate::handler::post_reaction::delete::handler,
crate::handler::post_mention::create::handler,
crate::handler::post_mention::list::handler,
crate::handler::post_watch::get::handler,
crate::handler::post_watch::upsert::handler,
crate::handler::post_watch::delete::handler,
crate::handler::post_label::create::handler,
crate::handler::post_label::list::handler,
crate::handler::post_label::get::handler,
crate::handler::post_label::update::handler,
crate::handler::post_label::delete::handler,
crate::handler::post_label::list_for_post::handler,
crate::handler::post_label::bind::handler,
crate::handler::post_label::unbind::handler,
),
components(schemas(
posts::PostBoardView,
posts::PostBoardPage,
posts::CreatePostBoardOption,
post::PostView,
post::PostPage,
post::PostStatusView,
post::CreatePostOption,
post::UpdatePostOption,
post::ListPostQuery,
post_reply::PostReplyView,
post_reply::PostReplyPage,
post_reply::CreateReplyOption,
post_reaction::PostReactionView,
post_reaction::PostTargetView,
post_reaction::CreatePostReactionOption,
post_mention::PostMentionView,
post_mention::CreateMentionOption,
post_watch::PostWatchView,
post_watch::UpsertPostWatchOption,
post_label::PostLabelView,
post_label::PostLabelPage,
post_label::CreatePostLabelOption,
post_label::UpdatePostLabelOption,
)),
tags((name = "posts", description = "Post discussion (lib/post)"))
)]
pub struct PostsApiDoc;
pub fn build_openapi() -> utoipa::openapi::OpenApi {
<PostsApiDoc as utoipa::OpenApi>::openapi()
}