Skip to content

⚠️ Correctly type properties on ErrorObject#2097

Merged
xavdid merged 2 commits into
masterfrom
RUN_DEVSDK-2568
Jul 13, 2026
Merged

⚠️ Correctly type properties on ErrorObject#2097
xavdid merged 2 commits into
masterfrom
RUN_DEVSDK-2568

Conversation

@xavdid

@xavdid xavdid commented Jul 10, 2026

Copy link
Copy Markdown
Member

Why?

Our main API Error class has always been handwritten. As new fields have been added to api_errors in the spec over time (e.g. advice_code, network_advice_code, network_decline_code), we haven't picked them up in the SDKs.

This makes most of those properties generated so they stay in sync.

Warning

this is maybe a breaking change for PHP because the types weren't correctly marked as nullable before (so correct code will have to handle the null case in a way it didn't before). There's no runtime impact, but it could mess up type checkers.

What?

  • Changes the properties on ErrorObject to be correctly nullable (pulling this data from the openapi spec).
  • Adds section markers so codegen can maintain these fields going forward
  • add tests

See Also

@xavdid xavdid marked this pull request as ready for review July 10, 2026 20:16
@xavdid xavdid requested a review from a team as a code owner July 10, 2026 20:16
@xavdid xavdid requested review from jar-stripe and kidus-stripe and removed request for a team July 10, 2026 20:16
@xavdid xavdid changed the title Make Error fields generated ⚠️ Correctly type properties on ErrorObject Jul 13, 2026
@xavdid xavdid enabled auto-merge (squash) July 13, 2026 21:38
@xavdid xavdid merged commit 289e556 into master Jul 13, 2026
25 checks passed
@xavdid xavdid deleted the RUN_DEVSDK-2568 branch July 13, 2026 21:38
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