fix(generated): update generated SDK from spec changes#372
Conversation
Greptile SummaryThis auto-generated PR updates the PHP SDK from spec changes, adding Groups service CRUD, WaitlistUser resources, new OAuth providers, renamed Authorization methods, and the
Confidence Score: 3/5Not 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
Reviews (1): Last reviewed commit: "fix(generated): update generated SDK fro..." | Re-trigger Greptile |
| ], fn ($v) => $v !== null); | ||
| if ($password instanceof PasswordPlaintext) { | ||
| $body['password'] = $password->password; | ||
| } elseif ($password instanceof PasswordHashed) { |
There was a problem hiding this comment.
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.
| ], 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; | |
| } |
| ], fn ($v) => $v !== null); | ||
| if ($password instanceof PasswordPlaintext) { | ||
| $body['password'] = $password->password; | ||
| } elseif ($password instanceof PasswordHashed) { |
There was a problem hiding this comment.
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.
| ], 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; | |
| } |
Summary
update generated SDK from spec changes
Spec Diff
Triggered by openapi-spec commit: 9998aeaecba4f3635f8beda2e3248f5a24b7e93f