Record the short URL and Basic endpoints - #3
Merged
Conversation
Fifteen responses recorded against a live account, and the two documented traps now have evidence behind them: a slug asked for without one of your own verified domains comes back as a generated path, and an unrecognised domain is quietly replaced by a default one. Both answer 200, so nothing but comparing the returned URL reveals what happened. Three other things worth having on file. A miss is a 200 with an empty data array rather than a 404. A Basic key used against the short URL endpoints is refused with 400 and a message about shortening, which points nowhere near the real cause — that it is a key for a different API — and the batch endpoints refuse it the same way. Every URL created while recording was deleted again. The Basic client had no feature test at all; it has one now. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The recorded content carried the real registered brand name. Nothing depends on it, and a fixture is read far more often than it is recorded. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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.
Recorded the short URL and Basic endpoints against a live account, the same
way the SMS ones were done, and built tests on what came back. Everything
created during the run was deleted again.
The two documented traps now have evidence
A slug is ignored unless the request names one of your own verified
domains. Asked for
/this-slug-is-ignored, got a generated path on adefault domain, with a 200 either way.
An unrecognised domain is substituted, not refused. Asked for
not-a-real-domain.invalid, got a default domain back — again a 200.Neither response says anything was dropped, so comparing the returned URL is
the only way to notice. Both are now pinned by tests; until now the README
described them and nothing checked them.
Three more things worth having on file
A miss is a 200 with an empty
dataarray, not a 404. The batch versionreturns nulls in the positions asked for, which is what keeps results from
silently shifting.
A Basic key used against the short URL endpoints is refused with 400 and a
message about shortening — which points nowhere near the real cause, that
it is a key for a different API. The batch endpoints refuse it the same way,
and both map to
PermissionException.The Basic client had no feature test at all. It has one now: the returned
URL, the request payload, and the credential and Accept headers.
Notes
Fixture hosts and the brand name in the SMS fixtures are placeholders; the
recordings they came from are not committed.
110 tests, up from 100.
🤖 Generated with Claude Code