feat(generated): OrganizationMembership (batch 4a353f07)#114
feat(generated): OrganizationMembership (batch 4a353f07)#114workos-sdk-automation[bot] wants to merge 2 commits into
Conversation
Greptile SummaryThis PR regenerates the organization membership SDK models. The main changes are:
Confidence Score: 2/5The generated membership models can reject valid rollout-era membership responses that omit the new plural roles array.
src/models/organization_membership.rs, src/models/user_organization_membership.rs, .last-synced-sha
What T-Rex did
|
| /// 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.
Required Roles Breaks Older Payloads
When the API returns a membership payload with the existing role field but no new roles array, serde treats this non-default Vec as required and fails deserialization with a missing-field error. That can break create_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
This is a comment left during a code review.
Path: src/models/organization_membership.rs
Line: 35
Comment:
**Required Roles Breaks Older Payloads**
When the API returns a membership payload with the existing `role` field but no new `roles` array, serde treats this non-default `Vec` as required and fails deserialization with a missing-field error. That can break `create_organization_membership`, `deactivate_organization_membership`, and any cached membership JSON produced before this field existed instead of returning the membership object.
How can I resolve this? If you propose a fix, please make it concise.| /// 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.
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.
Prompt To Fix With AI
This 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.
Summary
Regenerated SDK from spec changes.
Triggered by workos/openapi-spec@053f61e