Skip to content

Commit

Permalink
Fix postKind on swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
SHAcollision committed Aug 27, 2024
1 parent 61202a4 commit f4b3750
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pubky
Submodule pubky updated from a5dfff to 9131ce
4 changes: 3 additions & 1 deletion src/models/post/details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ use utoipa::ToSchema;

use super::PostStream;

/// Represents the type of pubky-app posted data
/// Used primarily to best display the content in UI
#[derive(Serialize, Deserialize, ToSchema, Default)]
enum PostKind {
pub enum PostKind {
#[default]
Short,
Long,
Expand Down
2 changes: 1 addition & 1 deletion src/models/post/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mod view;

pub use bookmark::Bookmark;
pub use counts::PostCounts;
pub use details::PostDetails;
pub use details::{PostDetails, PostKind};
pub use relationships::PostRelationships;
pub use stream::{PostStream, PostStreamReach, PostStreamSorting};
pub use thread::PostThread;
Expand Down
7 changes: 5 additions & 2 deletions src/routes/v0/post/details.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::models::post::PostDetails;
use crate::models::post::{PostDetails, PostKind};
use crate::routes::v0::endpoints::POST_DETAILS_ROUTE;
use crate::{Error, Result};
use axum::extract::Path;
Expand Down Expand Up @@ -36,5 +36,8 @@ pub async fn post_details_handler(
}

#[derive(OpenApi)]
#[openapi(paths(post_details_handler), components(schemas(PostDetails)))]
#[openapi(
paths(post_details_handler),
components(schemas(PostDetails, PostKind))
)]
pub struct PostDetailsApiDoc;

0 comments on commit f4b3750

Please sign in to comment.