Skip to content

Commit

Permalink
fix: correct docs host and path for API references
Browse files Browse the repository at this point in the history
The Stripe documentation now is hosted on https://docs.stripe.com/api. The old https://stripe.com/docs/api still works but gets redirected to the new one.
The issue is with how we use to generate documentation link on url_finder.rs. On that file, we look for the load the docs and find the window.__INITIAL_STATE__, which contains relative links to the resources.
We are using those relative links as if they were relative from https://stripe.com, but now they are relative from https://docs.stripe.com  which causes the links to not be correctly built.
This is the issue that is causing the verify-codegen CI job to fail.
By updating it to the right path, it should stop generating incorrect path to the docs.
  • Loading branch information
augustoccesar committed Sep 3, 2024
1 parent 71a904f commit 539836d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openapi/src/url_finder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl UrlFinder {
let object_names = [format!("{}_object", object_name), object_name];
for name in object_names {
if let Some(path) = self.url_lookup.get(&name) {
return Some(format!("https://stripe.com{}", path));
return Some(format!("https://stripe.com/docs{}", path));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/resources/generated/payment_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::resources::{

/// The resource representing a Stripe "PaymentLink".
///
/// For more details see <https://stripe.com/docs/api/payment_links/payment_links/object>
/// For more details see <https://stripe.com/docs/api/payment-link/object>
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentLink {
/// Unique identifier for the object.
Expand Down

0 comments on commit 539836d

Please sign in to comment.