diff --git a/crates/kitsune-type/src/mastodon/status.rs b/crates/kitsune-type/src/mastodon/status.rs index 6f087e162..5c80665d1 100644 --- a/crates/kitsune-type/src/mastodon/status.rs +++ b/crates/kitsune-type/src/mastodon/status.rs @@ -7,6 +7,7 @@ use utoipa::ToSchema; #[derive(Deserialize, Serialize, ToSchema)] pub struct Context { + #[schema(value_type = Vec)] pub ancestors: VecDeque, pub descendants: Vec, } diff --git a/kitsune/src/http/openapi.rs b/kitsune/src/http/openapi.rs index b9b56711c..124df2c9c 100644 --- a/kitsune/src/http/openapi.rs +++ b/kitsune/src/http/openapi.rs @@ -28,6 +28,10 @@ impl Modify for SecurityAddon { } } +#[derive(ToSchema)] +#[schema(as = SmolStr)] +struct SmolStrPolyfill(String); + #[derive(ToSchema)] #[schema(as = Timestamp)] struct TimestampPolyfill(String); @@ -35,6 +39,7 @@ struct TimestampPolyfill(String); #[derive(OpenApi)] #[openapi( components(schemas( + SmolStrPolyfill, TimestampPolyfill, mastodon_type::App, mastodon_type::account::Account, @@ -45,6 +50,8 @@ struct TimestampPolyfill(String); mastodon_type::instance::Instance, mastodon_type::media_attachment::MediaType, mastodon_type::media_attachment::MediaAttachment, + mastodon_type::preview_card::PreviewCard, + mastodon_type::preview_card::PreviewType, mastodon_type::relationship::Relationship, mastodon_type::search::SearchResult, mastodon_type::status::Context,