Filter out deprecated API endpoints from documentation #16158
Closed
+6
−189
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.
Summary
Problem
The OpenAPI spec contains many deprecated endpoints with
(DEPRECATED)in their operationId. These endpoints were being included in the documentation generation, but their descriptions contain links to replacement endpoints with anchor tags. Since the deprecated endpoints shouldn't have documentation pages, these links were causing 404 errors.Solution
Added filtering logic in
src/build/resolveOpenAPI.tsto skip any endpoint where theoperationIdcontains "(DEPRECATED)". This prevents pages from being generated for these endpoints.Fixes
/api/alerts/deprecated-update-a-metric-alert-rule/api/alerts/deprecated-update-an-issue-alert-ruleAnd all other deprecated endpoints in the OpenAPI schema.
Test plan