Skip to content

fix(generated): update generated SDK from spec changes#372

Merged
gjtorikian merged 1 commit intomainfrom
oagen/spec-update-9998aeaecba4f3635f8beda2e3248f5a24b7e93f
Apr 27, 2026
Merged

fix(generated): update generated SDK from spec changes#372
gjtorikian merged 1 commit intomainfrom
oagen/spec-update-9998aeaecba4f3635f8beda2e3248f5a24b7e93f

Conversation

@workos-sdk-automation
Copy link
Copy Markdown
Contributor

Summary

update generated SDK from spec changes

Spec Diff

  • Added: | Removed: | Modified: | Breaking:

Triggered by openapi-spec commit: 9998aeaecba4f3635f8beda2e3248f5a24b7e93f

@workos-sdk-automation workos-sdk-automation Bot requested a review from a team as a code owner April 27, 2026 21:15
@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label Apr 27, 2026
@workos-sdk-automation workos-sdk-automation Bot requested a review from a team as a code owner April 27, 2026 21:15
@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label Apr 27, 2026
@gjtorikian gjtorikian merged commit 0ee912a into main Apr 27, 2026
8 checks passed
@gjtorikian gjtorikian deleted the oagen/spec-update-9998aeaecba4f3635f8beda2e3248f5a24b7e93f branch April 27, 2026 21:16
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This auto-generated PR updates the PHP SDK from spec changes, adding Groups service CRUD, WaitlistUser resources, new OAuth providers, renamed Authorization methods, and the itContactEmails rename. One P1 regression was introduced in UserManagement.php:

  • $password->hashType (a CreateUserPasswordHashType backed enum) is placed directly into the JSON body array without calling ->value. PHP 8.2 does not serialize backed enums with json_encode — any createUser or updateUser call using PasswordHashed will throw a JsonException at runtime. The fix is $password->hashType->value in both createUser and updateUser.

Confidence Score: 3/5

Not safe to merge as-is — the PasswordHashed enum serialization bug will cause runtime failures for createUser/updateUser with hashed passwords.

Two P1 occurrences of the same defect (createUser and updateUser) reduce confidence below the P1 ceiling of 4. All other changes are clean generated code following established patterns.

lib/Service/UserManagement.php — both createUser and updateUser password_hash_type lines need ->value appended.

Important Files Changed

Filename Overview
lib/Service/UserManagement.php Refactored createUser/updateUser and createOrganizationMembership to use discriminated union objects; PasswordHashed.hashType (a backed enum) is passed to the JSON body without ->value, which will cause a JsonException at runtime.
lib/Service/Authorization.php Renamed several public methods and consolidated resource-target parameters into typed union objects; logic appears correct.
lib/Service/Groups.php New service class with full CRUD for organization groups and membership management; consistent with existing service patterns.
lib/WorkOS.php Added lazy-initialized accessors for Groups and UserManagementOrganizationMembershipGroups; moved hand-maintained properties block below public methods — pure reorganization.
lib/Resource/WaitlistUser.php New WaitlistUser resource with proper date handling and WaitlistUserState enum; looks correct.
lib/Resource/IntentOptions.php Made sso optional and added domainVerification; fromArray and toArray updated consistently.
lib/Resource/GenerateLink.php Renamed adminEmails → itContactEmails with matching API key change; consistent throughout.

Reviews (1): Last reviewed commit: "fix(generated): update generated SDK fro..." | Re-trigger Greptile

Comment on lines 681 to +684
], fn ($v) => $v !== null);
if ($password instanceof PasswordPlaintext) {
$body['password'] = $password->password;
} elseif ($password instanceof PasswordHashed) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Enum passed without ->value causes JSON serialization failure

$password->hashType is a CreateUserPasswordHashType backed enum. PHP 8.2 does not serialize backed enums to JSON by default — Guzzle's 'json' => option calls json_encode with JSON_THROW_ON_ERROR, so this will throw a JsonException any time createUser or updateUser is called with a PasswordHashed argument. The removed code correctly used $passwordHashType?->value.

Suggested change
], fn ($v) => $v !== null);
if ($password instanceof PasswordPlaintext) {
$body['password'] = $password->password;
} elseif ($password instanceof PasswordHashed) {
if ($password instanceof PasswordPlaintext) {
$body['password'] = $password->password;
} elseif ($password instanceof PasswordHashed) {
$body['password_hash'] = $password->hash;
$body['password_hash_type'] = $password->hashType->value;
}

Comment on lines 773 to +776
], fn ($v) => $v !== null);
if ($password instanceof PasswordPlaintext) {
$body['password'] = $password->password;
} elseif ($password instanceof PasswordHashed) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Same enum serialization bug in updateUser

Same issue as in createUser: $password->hashType is the enum instance rather than its string ->value, causing json_encode to throw a JsonException for any updateUser call with a PasswordHashed argument.

Suggested change
], fn ($v) => $v !== null);
if ($password instanceof PasswordPlaintext) {
$body['password'] = $password->password;
} elseif ($password instanceof PasswordHashed) {
if ($password instanceof PasswordPlaintext) {
$body['password'] = $password->password;
} elseif ($password instanceof PasswordHashed) {
$body['password_hash'] = $password->hash;
$body['password_hash_type'] = $password->hashType->value;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autogenerated Autogenerated code or content

Development

Successfully merging this pull request may close these issues.

1 participant