-
Notifications
You must be signed in to change notification settings - Fork 1
feat(generated): OrganizationMembership (batch 4a353f07) #114
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| * [#114](https://github.com/workos/workos-rust/pull/114) fix(generated): regenerate from spec | ||
|
|
||
| **Fixes** | ||
| * **[organization_membership](https://workos.com/docs/reference/authkit/organization-membership)**: | ||
| * Added `roles` to organization membership models |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| b6a68da8bd60c1478e0a86ca97c75448677e8871 | ||
| 1a2f47b20f63f2c8f0eb56bbd2adb3b5947d693a |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,8 @@ pub struct UserOrganizationMembership { | |
| pub updated_at: String, | ||
| /// The primary role assigned to the user within the organization. | ||
| pub role: SlimRole, | ||
| /// The list of roles assigned to the user within the organization. | ||
| pub roles: Vec<SlimRole>, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Prompt To Fix With AIThis is a comment left during a code review.
Path: src/models/user_organization_membership.rs
Line: 35
Comment:
**Required Roles Breaks Older Payloads**
When `get_organization_membership`, `update_organization_membership`, or `list_organization_memberships` receives a response that still only includes the singular `role`, this required `roles` field makes deserialization fail with a missing-field error. The SDK then returns an error for an otherwise valid membership response during rollout or for legacy payloads.
How can I resolve this? If you propose a fix, please make it concise. |
||
| /// The user that belongs to the organization through this membership. | ||
| pub user: User, | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the API returns a membership payload with the existing
rolefield but no newrolesarray, serde treats this non-defaultVecas required and fails deserialization with a missing-field error. That can breakcreate_organization_membership,deactivate_organization_membership, and any cached membership JSON produced before this field existed instead of returning the membership object.Prompt To Fix With AI