Skip to content

Commit

Permalink
helpers: Separate first sentence of docs from the rest
Browse files Browse the repository at this point in the history
Replaces an explicit line break that auto-format removed.
  • Loading branch information
svix-jplatte committed Mar 7, 2024
1 parent 615fe0d commit 4dd104c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/aide/src/helpers/no_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
use crate::{OperationInput, OperationOutput};

/// Allows non [`OperationInput`] or [`OperationOutput`] types to be used in aide handlers with a default empty documentation.
///
/// For types that already implement [`OperationInput`] or [`OperationOutput`] it overrides the documentation and hides it.
/// ```ignore
/// pub async fn my_sqlx_tx_endpoint(
Expand Down
1 change: 1 addition & 0 deletions crates/aide/src/helpers/use_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ impl<T> IntoApi for T {
}

/// Allows non [`OperationInput`] or [`OperationOutput`] types to be used in aide handlers with the api documentation of [A].
///
/// For types that already implement [`OperationInput`] or [`OperationOutput`] it overrides the documentation with the provided one.
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Serialize, Deserialize)]
pub struct UseApi<T, A>(pub T, pub PhantomData<A>);
Expand Down
2 changes: 2 additions & 0 deletions crates/aide/src/helpers/with_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::openapi::{Operation, Response};
use crate::{OperationInput, OperationOutput};

/// Trait that allows implementing a custom Api definition for any type.
///
/// Two approaches are possible:
///
/// 1. Simple Type override for concrete types
Expand Down Expand Up @@ -65,6 +66,7 @@ pub trait ApiOverride {
}

/// Allows non [`OperationInput`] or [`OperationOutput`] types to be used in aide handlers with a provided documentation.
///
/// For types that already implement [`OperationInput`] or [`OperationOutput`] it overrides the documentation with the provided one.
/// See [`ApiOverride`] on how to implement such an override
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Serialize, Deserialize)]
Expand Down

0 comments on commit 4dd104c

Please sign in to comment.