Fix REST API urls in documentation #970
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes apache/pulsar#21573
All REST API urls are incorrect in the documentation. This PR fixes the URLs for next, 4.0.x and 3.0.x.
This PR adds a custom Remark plugin that handles logic to lookup the correct URL from the Swagger JSON file so that it's always correct. The plugin is written in Typescript and to do that, the docusaurus config was converted to
.ts
extension and made compatible.There's a remaining problem that the Swagger files contain a lot of duplicate operations even after apache/pulsar#19193. The links to Swagger documentation won't work when there are duplicates, which is very common. A replacement will be needed in apache/pulsar for the Swagger generation to fix it. The duplicate operation names required adding ways to find the correct operation in the custom Remark plugin.
This PR replaces the previous draft PR #866.