Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(php): Union references render as class names and not mixed #5984

Merged
merged 4 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions generators/php/base/src/context/PhpTypeMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,8 @@ export class PhpTypeMapper {
case "enum":
return preserveEnums ? php.Type.reference(classReference) : php.Type.enumString(classReference);
case "object":
return php.Type.reference(classReference);
case "union":
return php.Type.mixed();
return php.Type.reference(classReference);
case "undiscriminatedUnion": {
return php.Type.union(
// need to dedupe because lists and sets are both represented as array
Expand Down
7 changes: 7 additions & 0 deletions generators/php/sdk/versions.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
- version: 0.13.1
changelogEntry:
- type: fix
summary: >-
Render union references as their type references rather than mixed.
irVersion: 55

- version: 0.13.0
changelogEntry:
- type: feat
Expand Down
13 changes: 7 additions & 6 deletions seed/php-sdk/unions/src/Bigunion/BigunionClient.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions seed/php-sdk/unions/src/Union/UnionClient.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading