Skip to content

MSD-14650: Add an API version option, defaulting to 2026-10 - #149

Merged
PeterOcansey merged 5 commits into
mainfrom
feature/msd-14650-11-pin-an-api-version-in-the-sdks-cli-and-mcp
Nov 20, 2026
Merged

PeterOcansey merged 5 commits into
mainfrom
feature/msd-14650-11-pin-an-api-version-in-the-sdks-cli-and-mcp

Conversation

@PeterOcansey

@PeterOcansey PeterOcansey commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds setApiVersion so requests can be pinned to a dated API version. Part of MSD-14650.

Changes

  • Requests go to 2026-10 by default, which returns the same responses as v1.
  • ms.setApiVersion("v1") changes the version, and getApiVersion() reads it back. It throws IllegalArgumentException for anything that isn't v1 or YYYY-MM.
  • Every endpoint passes the version to MailerSendApi.
  • The test VCR maps a dated version back to /v1/ when it looks up recordings, so the existing fixtures still match.
  • README "API version" section.

@PeterOcansey PeterOcansey self-assigned this Nov 5, 2026
…pin-an-api-version-in-the-sdks-cli-and-mcp

# Conflicts:
#	src/test/java/com/mailersend/sdk/tests/EmailsTest.java
@PeterOcansey
PeterOcansey marked this pull request as ready for review November 18, 2026 10:21
@mailerlite-kritika

mailerlite-kritika Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Re-runViewConfidence Score: 4/5

[High risk] The change moves every endpoint's default from v1 to 2026-10 for all SDK users, and the only support for that is the description's claim that 2026-10 returns the same responses as v1; the review read no changelog or upstream source for that version, so a field or behavior difference would break every caller silently on upgrade. The Account.java gap from the last review is closed by the diff, which now calls setApiVersion there, and the grep found no other MailerSendApi call site missing it. Risk …

Findings

Fixed since the last review (1)

Summary

Adds setApiVersion and defaults SDK requests to API version 2026-10

  • Every request now goes to /2026-10/... by default, and ms.setApiVersion("v1") switches it back.
  • Invalid versions throw IllegalArgumentException in MailerSend.setApiVersion, so a bad value fails at configuration time.
  • The VCR maps dated URLs to /v1/ so the existing recorded fixtures still match.

What's good

  • Version validation is strict (v1 or YYYY-MM with a month check) and is covered by a test.
  • Tests assert both the default and an overridden version in the request URL, including the account endpoint.
Review context · 1/5 commands
  • Commands run: grep

Reviews (4) · Last reviewed commit: "Request the account with the configured..." · claude-sonnet-5-5

@PeterOcansey
PeterOcansey merged commit 8d1af72 into main Nov 20, 2026
4 checks passed
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.

2 participants