feat(api): Use region-specific URLs in API doc curl examples#17779
Open
mwarkentin wants to merge 5 commits into
Open
feat(api): Use region-specific URLs in API doc curl examples#17779mwarkentin wants to merge 5 commits into
mwarkentin wants to merge 5 commits into
Conversation
Read the global `servers` field from the OpenAPI spec instead of
hardcoding `sentry.io` as the base URL for curl examples. The spec
defines `https://{region}.sentry.io` with region enum (us, de), so
curl examples now render as `https://us.sentry.io/api/0/...` with a
region picker (US | DE tabs) above the code block.
For logged-in users, the region is auto-detected from their
CodeContext project data so the correct regional endpoint is
pre-selected.
Refs INC-2335
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Satisfy CodeQL js/regex/missing-regexp-anchor by requiring a `/` after `.sentry.io` so the pattern cannot match lookalike domains. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Fixes react-hooks/exhaustive-deps lint error where the fallback empty array created a new reference on every render. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b2ecd86. Configure here.
6 tasks
Read sharedKeywordSelection to resolve the user's currently selected project instead of always reading PROJECT[0]. This ensures the region tab matches when users switch between projects in different regions. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

DESCRIBE YOUR PR
API doc pages (e.g.
/api/explore/query-explore-events-in-table-format/) currently render curl examples withhttps://sentry.io/api/0/...as the base URL. This ignores the OpenAPI spec'sserversfield which defines region-specific URLs (https://{region}.sentry.io).This PR:
serversfield from the OpenAPI spec instead of hardcodingsentry.io. Per-operation server overrides are still respected first, then the global servers block, thenhttps://sentry.ioas a safety fallback.https://us.sentry.io/api/0/...andhttps://de.sentry.io/api/0/....API_URLfromCodeContext, pre-selecting the correct tab.This steers customers (especially those on the DE region) toward the correct regional endpoint, avoiding cross-Atlantic RPCs.
Refs INC-2335
IS YOUR CHANGE URGENT?
PRE-MERGE CHECKLIST
Made with Cursor