Skip to content

Conversation

@ShreyaThapa
Copy link
Contributor

This PR replaces single-value enum constraints on a few error code fields with plain string + example. Speakeasy was generating PHP string-backed enums for these codes, which then triggered PHPStan failures due to (int) $code casts in generated toException() methods.

Why

  • Single-value enums for error codes don’t add meaningful validation value, but they change SDK typing (enum vs string).
  • In the generated PHP SDK, this resulted in PHPStan errors like “Cannot cast … to int” when building exception objects.

Impact / Compatibility

  • No API behavior change (response payloads unchanged).
  • Improves SDK generation compatibility, especially for PHP; reduces likelihood of downstream type/cast issues.
    Other SDKs should be unaffected or improved (strings are broadly compatible).

@ShreyaThapa ShreyaThapa merged commit 05c6938 into main Jan 13, 2026
5 checks passed
@ShreyaThapa ShreyaThapa deleted the DEV-1874 branch January 13, 2026 17:09
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