Skip to content

Remove the documented 500 responses from the contacts spec - #65

Merged
Rabsztok merged 3 commits into
mainfrom
pr-0-remove-the-documented-500-responses
Nov 6, 2026
Merged

Rabsztok merged 3 commits into
mainfrom
pr-0-remove-the-documented-500-responses

Conversation

@Rabsztok

@Rabsztok Rabsztok commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Motivation

The contacts reference lists a 500 "Internal error" response on all 20 of its operations. A 500 is an unexpected server failure, not part of the API contract: no request can be built to get one, and what a client can do about it (retry, contact support) is the same for every endpoint. None of the other mailtrap.io specs documents a 500, so the contacts pages now match them.

Changes

  • the Contacts, Contact Events, Export Contacts, Bulk Import, Contact Lists and Contact Fields operations no longer list a 500 response, and the shared "Internal error" response, which nothing else used, is gone. Every other documented status stays as it was
  • the 500s in the transactional, bulk and sandbox sending specs stay: those document the sending APIs (send.api, bulk.api, sandbox.api), which are separate services with their own error responses

How to test

  • Contacts pages: Contacts, Contact Events, Export Contacts, Bulk Import, Contact Lists and Contact Fields show no 500 response on any operation
  • Regression, contacts: the other statuses are still there, e.g. "Get a list of contacts" lists 200, 401, 403, 422 and 429, and "Delete contact" lists 204, 401, 403, 404 and 429
  • Regression, sending: the transactional, bulk and sandbox send pages still list their 500

Summary by CodeRabbit

  • Documentation
    • Updated the contacts API reference to no longer document 500 Internal Server Error responses for contact, contact-event, export, import, contact-list, and contact-field operations.
    • Removed the shared internal-error response definition from the API documentation. This changes the documented responses, not necessarily the behavior of the API.

Decisions:
- A 500 is an unexpected failure, not part of the API contract: no request can be built to get it, so the mailtrap.io API documents none
- INTERNAL_ERROR had no other users once the 500s were gone; ErrorResponse stays, as the list contacts 422 and the delete contact 404 use it
- The 500s in the transactional, bulk and sandbox sending specs stay: those documents describe other services (send.api, bulk.api, sandbox.api)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 69217c5f-36c3-4dcb-b4f4-c349f063883e

No actionable comments were generated in the recent review.

Walkthrough

The contacts OpenAPI specification removes documented 500 responses from contact, event, export, import, list, and field endpoints. It also removes the shared INTERNAL_ERROR response component.

Changes: Contacts API specification

Layer / File(s) Summary
Remove documented internal error responses
specs/contacts.openapi.yml
Removed the documented 500 response from contact, event, export, import, list, and field endpoints. Removed the shared INTERNAL_ERROR response component.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: gannarw

Merge Risk: Minimal · previous review 203fb

The documentation cleanup is internally consistent and introduces no identified merge-blocking risk.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title "Remove the documented 500 responses from the contacts spec" matches the main change. The raw summary shows the 500 Internal Server Error responses removed from contacts-related operations i…
Description check Passed The description follows the template sections: Motivation, Changes, How to test, and a Images and GIFs section that is absent. The author explains why the 500 responses are removed, lists the affected…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Remove the documented 500 responses from the contacts spec" matches the main change. The raw summary shows the 500 Internal Server Error responses removed from contacts-related operations in specs/contacts.openapi.yml, along with the shared INTERNAL_ERROR response component. The title is specific and concise, and it does not cover the unchanged sending specs, which is expected.

Full details: Description check

Explanation

The description follows the template sections: Motivation, Changes, How to test, and a Images and GIFs section that is absent. The author explains why the 500 responses are removed, lists the affected operations and the shared component that is removed, states that other statuses and the sending specs are unchanged, and gives a regression test plan. The before/after images table is not filled in, and it is a non-critical section for a spec-only change. The test checkboxes are unchecked, which is normal before merge.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b37920c5-d5d7-4836-9975-4beb3fa79330
Commits

Reviewing files that changed from the base of the PR and between fb6c730 and 203fbb1.

Files selected for processing: 1

  • specs/contacts.openapi.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@Rabsztok

Rabsztok commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Decisions:
- "Unexpected error" was the removed 500's body; the schema now only backs the 404 and 422, so it showed a response the spec no longer documents
- "Invalid token" is the string-form error listContacts' 422 already returns for a malformed pagination cursor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rabsztok

Rabsztok commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Decisions:
- The schema backs both the list contacts 422 and the delete contact 404, so one specific message misleads on the other; "Invalid token" read like an auth error under a 404
- Both responses set their own examples, so the schema-level one added nothing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rabsztok
Rabsztok marked this pull request as ready for review November 5, 2026 12:41
@Rabsztok
Rabsztok requested review from izikaj and oshchyhol November 5, 2026 12:42
@Rabsztok
Rabsztok merged commit c1223a3 into main Nov 6, 2026
2 checks passed
@Rabsztok
Rabsztok deleted the pr-0-remove-the-documented-500-responses branch November 6, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants