You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2026/06/17 21:51:24 UTC

(pulsar-site) 01/02: Point next-docs REST API links to master version

This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git

commit 9d725702a0c07ca4458928bada1a9d9443cc0563
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Thu Jun 18 00:36:19 2026 +0300

    Point next-docs REST API links to master version
    
    The next/current docs rendered REST API links as ?version=<latest release>
    (e.g. 4.2.2) because they used the @pulsar:version_number@ token. The REST
    API viewer keys the in-development spec under "master", so next docs should
    link to ?version=master.
    
    Add a dedicated @pulsar:rest_api_version@ token that resolves to "master"
    for the next/current docs and to the concrete release for versioned docs,
    and switch the REST API ?version= links in the next docs to use it.
---
 docs/admin-api-tools.md             |  4 ++--
 docs/admin-api-tutorial.md          |  2 +-
 docs/admin-get-started.md           |  2 +-
 docs/concepts-throttling.md         |  2 +-
 docs/reference-rest-api-overview.md | 14 +++++++-------
 src/config/pulsarVariables.ts       |  8 ++++++++
 6 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/docs/admin-api-tools.md b/docs/admin-api-tools.md
index 6065e806041..de8eec6fab1 100644
--- a/docs/admin-api-tools.md
+++ b/docs/admin-api-tools.md
@@ -18,7 +18,7 @@ You can manage Pulsar entities through the Pulsar admin layer via one of the fol
 
   - Go admin API (coming soon)
 
-  - [REST API](pathname:///admin-rest-api/?version=@pulsar:version_number@): HTTP calls, which are made against the admin APIs provided by brokers. In addition, both the Java admin API and pulsar-admin CLI use the REST API.
+  - [REST API](pathname:///admin-rest-api/?version=@pulsar:rest_api_version@): HTTP calls, which are made against the admin APIs provided by brokers. In addition, both the Java admin API and pulsar-admin CLI use the REST API.
 
 - [pulsar-admin CLI](/reference/#/@pulsar:version_reference@/pulsar-admin/): It’s a command-line tool and is available in the bin folder of your Pulsar installation.
 
@@ -29,7 +29,7 @@ Here are the explanations and comparisons of these tools.
 Category|Tools|When to use|Considerations
 |---|---|---|---
 Pulsar admin APIs|[Java admin API](@pulsar:javadoc:admin@/)| - If you want to implement your own admin interface client using Java and manage clusters. <br/><br/> - If you want to manage resources programmatically rather than relying on external tools inside of unit tests.<br/><br/> - If you want to use admin APIs in Java applications.| <br/><br/> - This method is only available in Java. <br/><br/> - It needs more development work if you want to use it to build applications.
-Pulsar admin APIs | [REST API](pathname:///admin-rest-api/?version=@pulsar:version_number@)|- If you want to implement your own admin interface client using other languages and manage clusters using scripts.| - This method is the most complicated. <br/><br/> - It needs more development work if you want to use it to build applications.
+Pulsar admin APIs | [REST API](pathname:///admin-rest-api/?version=@pulsar:rest_api_version@)|- If you want to implement your own admin interface client using other languages and manage clusters using scripts.| - This method is the most complicated. <br/><br/> - It needs more development work if you want to use it to build applications.
 Pulsar admin CLI| [pulsar-admin CLI](/reference/#/@pulsar:version_reference@/pulsar-admin/) | - If you want to get started with Pulsar admin APIs with minimal effort (e.g., no need to prepare an extra environment). <br/><br/> - If you want to perform common administrative tasks.| - This method is the most easy-to-use. <br/><br/> - It’s challenging to use this method to build applications.<br/><br/> - It takes a little more time because JVM starts slowly.
 
 ### Related topics
diff --git a/docs/admin-api-tutorial.md b/docs/admin-api-tutorial.md
index 942e4eca5cc..e1f64314014 100644
--- a/docs/admin-api-tutorial.md
+++ b/docs/admin-api-tutorial.md
@@ -35,7 +35,7 @@ If you have enabled authentication, you need to provide an auth configuration to
 </TabItem>
 <TabItem value="REST API">
 
-You can find details for the REST API exposed by Pulsar brokers in the [REST API doc](pathname:///admin-rest-api/?version=@pulsar:version_number@).
+You can find details for the REST API exposed by Pulsar brokers in the [REST API doc](pathname:///admin-rest-api/?version=@pulsar:rest_api_version@).
 
 If you want to test REST APIs in postman, you can use the REST API JSON files [here](pathname:///swagger/).
 
diff --git a/docs/admin-get-started.md b/docs/admin-get-started.md
index 8a4f453fc8f..25a2449d4b5 100644
--- a/docs/admin-get-started.md
+++ b/docs/admin-get-started.md
@@ -23,7 +23,7 @@ This guide walks you through the quickest way to get started with the following
 </TabItem>
 <TabItem value="REST API">
 
-[REST API](pathname:///admin-rest-api/?version=@pulsar:version_number@) belongs to HTTP calls, which are made against the admin APIs provided by brokers. In addition, both the Java admin API and pulsar-admin CLI use the REST API.
+[REST API](pathname:///admin-rest-api/?version=@pulsar:rest_api_version@) belongs to HTTP calls, which are made against the admin APIs provided by brokers. In addition, both the Java admin API and pulsar-admin CLI use the REST API.
 
 </TabItem>
 <TabItem value="Java">
diff --git a/docs/concepts-throttling.md b/docs/concepts-throttling.md
index a4ab06d1fd3..29a23c1a3f2 100644
--- a/docs/concepts-throttling.md
+++ b/docs/concepts-throttling.md
@@ -71,7 +71,7 @@ Approach | Per cluster | Per topic | Per subscription
 :--------|:------------|:----------|:----------------
 Set [broker configurations](#throttling-configurations) or [dynamic broker configurations](admin-api-brokers.md#dynamic-broker-configuration) | <li>`dispatchThrottlingRateInMsg`</li><li>`dispatchThrottlingRateInByte`</li> | <li>`dispatchThrottlingRatePerTopicInMsg`</li><li>`dispatchThrottlingRatePerTopicInByte`</li><br />It applies to all topics in the cluster. | <li>`dispatchThrottlingRatePerSubscriptionInMsg`</li><li>`dispatchThrottlingRatePerSubscriptionInByte`</li><br />It applies to [...]
 Set namespace policies | N/A | Refer to [Configure dispatch throttling for topics](admin-api-namespaces.md#configure-dispatch-throttling-for-topics). | Refer to [Configure dispatch throttling for subscriptions](admin-api-namespaces.md#configure-dispatch-throttling-for-subscription).
-Set topic policies | N/A | Refer to [Set topic-level dispatch rate](pathname:///admin-rest-api/?version=@pulsar:version_number@/#operation/PersistentTopics_setDispatchRate). | Refer to [Set subscription-level dispatch rate](pathname:///admin-rest-api/?version=@pulsar:version_number@/#operation/PersistentTopics_setSubscriptionDispatchRate).<br />It applies to all subscriptions in a topic.
+Set topic policies | N/A | Refer to [Set topic-level dispatch rate](pathname:///admin-rest-api/?version=@pulsar:rest_api_version@/#operation/PersistentTopics_setDispatchRate). | Refer to [Set subscription-level dispatch rate](pathname:///admin-rest-api/?version=@pulsar:rest_api_version@/#operation/PersistentTopics_setSubscriptionDispatchRate).<br />It applies to all subscriptions in a topic.
 
 :::note
 
diff --git a/docs/reference-rest-api-overview.md b/docs/reference-rest-api-overview.md
index f6551281360..c10b748e8d4 100644
--- a/docs/reference-rest-api-overview.md
+++ b/docs/reference-rest-api-overview.md
@@ -11,11 +11,11 @@ Pulsar provides a variety of REST APIs that enable you to interact with Pulsar t
 
 | REST API category | Description |
 | --- | --- |
-| [Admin](/admin-rest-api/?version=@pulsar:version_number@) | REST APIs for administrative operations.|
-| [Functions](/functions-rest-api/?version=@pulsar:version_number@) | REST APIs for function-specific operations.|
-| [Sources](/source-rest-api/?version=@pulsar:version_number@) | REST APIs for source-specific operations.|
-| [Sinks](/sink-rest-api/?version=@pulsar:version_number@) | REST APIs for sink-specific operations.|
-| [Packages](/packages-rest-api/?version=@pulsar:version_number@) | REST APIs for package-specific operations. A package can be a group of functions, sources, and sinks.|
-| [Transactions](/transactions-rest-api/?version=@pulsar:version_number@) | REST APIs for transaction-specific operations.|
-| [Lookup](/lookup-rest-api/?version=@pulsar:version_number@) | REST APIs for lookup-specific operations, such as getting the owner broker of a topic, getting the namespace bundle that a topic belongs to, and so on.|
+| [Admin](/admin-rest-api/?version=@pulsar:rest_api_version@) | REST APIs for administrative operations.|
+| [Functions](/functions-rest-api/?version=@pulsar:rest_api_version@) | REST APIs for function-specific operations.|
+| [Sources](/source-rest-api/?version=@pulsar:rest_api_version@) | REST APIs for source-specific operations.|
+| [Sinks](/sink-rest-api/?version=@pulsar:rest_api_version@) | REST APIs for sink-specific operations.|
+| [Packages](/packages-rest-api/?version=@pulsar:rest_api_version@) | REST APIs for package-specific operations. A package can be a group of functions, sources, and sinks.|
+| [Transactions](/transactions-rest-api/?version=@pulsar:rest_api_version@) | REST APIs for transaction-specific operations.|
+| [Lookup](/lookup-rest-api/?version=@pulsar:rest_api_version@) | REST APIs for lookup-specific operations, such as getting the owner broker of a topic, getting the namespace bundle that a topic belongs to, and so on.|
 
diff --git a/src/config/pulsarVariables.ts b/src/config/pulsarVariables.ts
index ac18cc1dac3..a220e5981f8 100644
--- a/src/config/pulsarVariables.ts
+++ b/src/config/pulsarVariables.ts
@@ -153,6 +153,12 @@ export function referenceVersion(version: string): string {
  * resolves to the latest stable release's reference (e.g. `4.2.x`) instead of `next`,
  * so links like `/reference/#/@pulsar:version_reference@/client/` target the published
  * reference rather than the in-development one.
+ *
+ * `rest_api_version` is the value for the `?version=` query parameter on REST API
+ * pages (e.g. `/admin-rest-api/?version=@pulsar:rest_api_version@`). For the next/current
+ * docs it resolves to `master` (the in-development API), since the REST API viewer keys
+ * the in-development spec under `master` rather than a numbered release. Versioned docs
+ * resolve it to their concrete release, matching `version_number`.
  */
 export function resolveTokens(versionKey: string, referenceLatest = false): Map<string, string> {
   const isCurrent = versionKey === "current";
@@ -165,6 +171,7 @@ export function resolveTokens(versionKey: string, referenceLatest = false): Map<
   const versionNumber = isCurrent ? resolvedVersion : resolvedVersion.replace("-incubating", "");
   const versionOrigin = isCurrent ? resolvedVersion : originVersion;
   const versionReference = isCurrent && !referenceLatest ? "next" : referenceVersion(resolvedVersion);
+  const restApiVersion = isCurrent ? "master" : versionNumber;
   const pythonArg = isCurrent ? originVersion : resolvedVersion;
 
   return new Map<string, string>([
@@ -185,6 +192,7 @@ export function resolveTokens(versionKey: string, referenceLatest = false): Map<
     ["javadoc:pulsar-functions", javadocVersionUrl(originVersion, "pulsar-functions")],
     ["offloader_release_url", offloaderReleaseUrl(resolvedVersion)],
     ["presto_pulsar_connector_release_url", prestoPulsarReleaseUrl(resolvedVersion)],
+    ["rest_api_version", restApiVersion],
     ["rpm:client-debuginfo", rpmDistUrl(resolvedVersion, "-debuginfo")],
     ["rpm:client-devel", rpmDistUrl(resolvedVersion, "-devel")],
     ["rpm:client", rpmDistUrl(resolvedVersion, "")],