From 539836d01904742110171a9d6ef877b4cc3f87a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Augusto=20C=C3=A9sar?= Date: Sun, 1 Sep 2024 15:08:38 +0200 Subject: [PATCH] fix: correct docs host and path for API references 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. --- openapi/src/url_finder.rs | 2 +- src/resources/generated/payment_link.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi/src/url_finder.rs b/openapi/src/url_finder.rs index 70b2608d2..9e631ae11 100644 --- a/openapi/src/url_finder.rs +++ b/openapi/src/url_finder.rs @@ -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)); } } diff --git a/src/resources/generated/payment_link.rs b/src/resources/generated/payment_link.rs index 01a778d58..6254eb07a 100644 --- a/src/resources/generated/payment_link.rs +++ b/src/resources/generated/payment_link.rs @@ -14,7 +14,7 @@ use crate::resources::{ /// The resource representing a Stripe "PaymentLink". /// -/// For more details see +/// For more details see #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentLink { /// Unique identifier for the object.