diff --git a/async-stripe-webhook/Cargo.toml b/async-stripe-webhook/Cargo.toml index 92c2bcc61..44d1a0848 100644 --- a/async-stripe-webhook/Cargo.toml +++ b/async-stripe-webhook/Cargo.toml @@ -24,13 +24,34 @@ chrono = { version = "0.4", default-features = false, features = ["clock"] } thiserror = "1.0.24" miniserde.workspace = true serde.workspace = true +serde_json = { workspace = true, optional = true } -async-stripe-core = { path = "../generated/async-stripe-core", optional = true } -async-stripe-checkout = { path = "../generated/async-stripe-checkout", optional = true } async-stripe-billing = { path = "../generated/async-stripe-billing", optional = true } +async-stripe-checkout = { path = "../generated/async-stripe-checkout", optional = true } +async-stripe-core = { path = "../generated/async-stripe-core", optional = true } +async-stripe-fraud = { path = "../generated/async-stripe-fraud", optional = true } +async-stripe-misc = { path = "../generated/async-stripe-misc", optional = true } +async-stripe-payment = { path = "../generated/async-stripe-payment", optional = true } +async-stripe-terminal = { path = "../generated/async-stripe-terminal", optional = true } +async-stripe-treasury = { path = "../generated/async-stripe-treasury", optional = true } [dev-dependencies] serde_json.workspace = true +[features] +serialize = ["async-stripe-types/serialize", "async-stripe-shared/serialize"] +deserialize = ["async-stripe-types/deserialize", "async-stripe-shared/deserialize", "dep:serde_json"] + +full = [ + "async-stripe-billing", + "async-stripe-checkout", + "async-stripe-core", + "async-stripe-fraud", + "async-stripe-misc", + "async-stripe-payment", + "async-stripe-terminal", + "async-stripe-treasury", +] + [package.metadata.docs.rs] -features = ["async-stripe-core", "async-stripe-checkout", "async-stripe-billing"] \ No newline at end of file +features = ["full"] diff --git a/async-stripe-webhook/src/webhook.rs b/async-stripe-webhook/src/webhook.rs index 7ce4a8ecc..f512df7ff 100644 --- a/async-stripe-webhook/src/webhook.rs +++ b/async-stripe-webhook/src/webhook.rs @@ -279,7 +279,7 @@ mod tests { assert_eq!(invoice.quantity, 3); } - #[cfg(feature = "stripe_billing")] + #[cfg(feature = "async-stripe-billing")] #[test] // https://github.com/arlyon/async-stripe/issues/455 fn test_billing_portal_session() { diff --git a/async-stripe/src/lib.rs b/async-stripe/src/lib.rs index e4cc7a1db..04550a92a 100644 --- a/async-stripe/src/lib.rs +++ b/async-stripe/src/lib.rs @@ -29,9 +29,9 @@ //! to determine which fields are required for either request. //! //! > **Note:** We have an extensive collection of examples which are interspersed in -//! the documentation. Any time an API is used in an example it is highlighted in the -//! docs for that item. You can also find all the raw examples in the `examples` directory. -//! Please have a look at those for inspiration or ideas on how to get started. +//! > the documentation. Any time an API is used in an example it is highlighted in the +//! > docs for that item. You can also find all the raw examples in the `examples` directory. +//! > Please have a look at those for inspiration or ideas on how to get started. //! //! ## Idempotency / Request Strategies //! @@ -51,7 +51,7 @@ //! generated automatically and is stable across retries. //! //! > Want to implement your own? If it is a common strategy, please consider opening a PR to add it to the library. -//! Otherwise, we are open to turning this into an open trait so that you can implement your own strategy. +//! > Otherwise, we are open to turning this into an open trait so that you can implement your own strategy. #![warn(clippy::missing_errors_doc, clippy::missing_panics_doc)] #![deny(missing_docs, missing_debug_implementations)] diff --git a/generated/async-stripe-shared/src/invoice.rs b/generated/async-stripe-shared/src/invoice.rs index 7996fcac9..8ddc46d12 100644 --- a/generated/async-stripe-shared/src/invoice.rs +++ b/generated/async-stripe-shared/src/invoice.rs @@ -71,7 +71,7 @@ pub struct Invoice { /// /// * `manual`: Unrelated to a subscription, for example, created via the invoice editor. /// * `subscription`: No longer in use. - /// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. + /// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. /// * `subscription_create`: A new subscription was created. /// * `subscription_cycle`: A subscription advanced into a new period. /// * `subscription_threshold`: A subscription reached a billing threshold. @@ -893,7 +893,7 @@ impl serde::Serialize for Invoice { /// /// * `manual`: Unrelated to a subscription, for example, created via the invoice editor. /// * `subscription`: No longer in use. -/// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. +/// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. /// * `subscription_create`: A new subscription was created. /// * `subscription_cycle`: A subscription advanced into a new period. /// * `subscription_threshold`: A subscription reached a billing threshold. diff --git a/openapi/src/templates/utils.rs b/openapi/src/templates/utils.rs index e4e3b3376..a9d6b0d68 100644 --- a/openapi/src/templates/utils.rs +++ b/openapi/src/templates/utils.rs @@ -184,12 +184,20 @@ pub fn write_doc_comment(description: &str, depth: u8) -> String { out.push_str(line); // If an unreasonable line, inject newlines after each sentence } else { + let is_list_item = line.starts_with("* "); + for (i, part) in PERIOD_THEN_WHITESPACE.split(line).enumerate() { if i > 0 { out.push('\n'); } print_indent(&mut out, depth); - out.push_str("/// "); + + if is_list_item && i > 0 { + out.push_str("/// "); + } else { + out.push_str("/// "); + } + out.push_str(part.trim()); if !part.is_empty() && !out.ends_with('.') { out.push('.');