MT-22654: Document tracking opt-outs public API#46
Conversation
📝 WalkthroughWalkthroughThe OpenAPI spec adds tracking opt-out documentation, domain setting fields, and new list/create/delete tracking opt-out endpoints with supporting parameters, schemas, and responses. ChangesTracking opt-out OpenAPI additions
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@specs/email-sending.openapi.yml`:
- Around line 1422-1431: The create/delete tracking opt-outs docs only include
cURL, so the standard code sample tabs are missing for these operations. Update
the x-codeSamples blocks in the tracking_opt_outs POST/DELETE sections to follow
the repo’s usual priority order: cURL, Node.js, PHP, Python, Ruby, .NET, and
Java, and include the same explicit “SDK does not yet support tracking opt-outs”
limitation note for the unsupported SDK entries. Use the existing tracking
opt-outs sample patterns in this spec to keep the language ordering and
messaging consistent.
- Around line 1323-1368: The Node.js x-codeSamples entry for tracking opt-outs
mixes a MailtrapClient instantiation with a raw fetch call, which is misleading
because it implies SDK support that does not exist. Update the JavaScript sample
to match the other language blocks by replacing the example in the tracking
opt-outs section with an SDK-limitation note, and remove the
MailtrapClient/getTrackingOptOuts sample so readers are directed to the cURL
example until the SDK supports this endpoint.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9fc7721e-0a63-4262-ab46-ae21764c1070
📒 Files selected for processing (1)
specs/email-sending.openapi.yml
| x-codeSamples: | ||
| - lang: shell | ||
| label: 'cURL' | ||
| source: | | ||
| curl -X POST https://mailtrap.io/api/tracking_opt_outs \ | ||
| -H 'Authorization: Bearer YOUR_API_KEY' \ | ||
| -H 'Content-Type: application/json' \ | ||
| -d '{ | ||
| "email": "tracked@example.com" | ||
| }' |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add the missing language sample slots for create/delete tracking opt-outs.
Line 1422 and Line 1469 only provide cURL. For spec files in this repo, x-codeSamples should still keep the standard language order, and unsupported SDK entries should be present with an explicit limitation note. Right now the POST/DELETE docs will lose the usual tabs and won’t communicate why the SDK samples are missing.
Based on learnings, populate x-codeSamples in the exact priority order with cURL first, then Node.js, PHP, Python, Ruby, .NET, and Java, using the same “SDK does not yet support tracking opt-outs” note you already added elsewhere.
Also applies to: 1469-1474
🧰 Tools
🪛 Betterleaks (1.5.0)
[high] 1426-1427: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@specs/email-sending.openapi.yml` around lines 1422 - 1431, The create/delete
tracking opt-outs docs only include cURL, so the standard code sample tabs are
missing for these operations. Update the x-codeSamples blocks in the
tracking_opt_outs POST/DELETE sections to follow the repo’s usual priority
order: cURL, Node.js, PHP, Python, Ruby, .NET, and Java, and include the same
explicit “SDK does not yet support tracking opt-outs” limitation note for the
unsupported SDK entries. Use the existing tracking opt-outs sample patterns in
this spec to keep the language ordering and messaging consistent.
Sources: Coding guidelines, Learnings
a3286eb to
e4694bd
Compare
Decisions: - Mirror suppressions path style (`/api/tracking_opt_outs`) for account-scoped v2 endpoints - SDK samples deferred until client libraries ship tracking opt-out support Co-authored-by: Cursor <cursoragent@cursor.com>
e4694bd to
2a395ff
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@specs/email-sending.openapi.yml`:
- Around line 1316-1326: Add Node.js, PHP, Python, Ruby, .NET, and Java
x-codeSamples blocks to the GET tracking opt-outs endpoint at
specs/email-sending.openapi.yml:1316-1326, each noting that the SDK does not yet
support tracking opt-outs. Add the same language slots and SDK-limitation notes
to the POST endpoint at specs/email-sending.openapi.yml:1381-1391 and DELETE
endpoint at specs/email-sending.openapi.yml:1433-1438, preserving the existing
cURL examples and required language order.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: afc8cc8e-12ef-4690-a5e8-6dfb548a75ca
📒 Files selected for processing (1)
specs/email-sending.openapi.yml
Motivation
https://railsware.atlassian.net/browse/MT-22654
Changes
tracking-opt-outstag and CRUD paths inemail-sending.openapi.yml(GET/POST/api/tracking_opt_outs,DELETE/api/tracking_opt_outs/{id})email,start_time,end_time,last_id), pagination limit, and rate limitsTrackingOptOutschema and response components matching Falcon v2 shapestracking_opt_out_enabledon sending domain GET/PATCHHow to test
Made with Cursor
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Documentation