Skip to content

feat(generated): OrganizationMembership (batch 4a353f07)#114

Open
workos-sdk-automation[bot] wants to merge 2 commits into
mainfrom
oagen/batch-4a353f07
Open

feat(generated): OrganizationMembership (batch 4a353f07)#114
workos-sdk-automation[bot] wants to merge 2 commits into
mainfrom
oagen/batch-4a353f07

Conversation

@workos-sdk-automation

Copy link
Copy Markdown
Contributor

Summary

Regenerated SDK from spec changes.

Triggered by workos/openapi-spec@053f61e

@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown

Greptile Summary

This PR regenerates the organization membership SDK models. The main changes are:

  • Adds a plural roles field to organization membership models.
  • Updates membership fixtures to include a roles array.
  • Updates the last synced OpenAPI SHA.

Confidence Score: 2/5

The generated membership models can reject valid rollout-era membership responses that omit the new plural roles array.

  • OrganizationMembership and UserOrganizationMembership now require roles during deserialization, so otherwise valid responses that still include only role can fail.
  • The affected paths cover create, deactivate, get, update, and list membership flows, making this a user-visible SDK compatibility issue.
  • The checked sync marker also does not match the OpenAPI commit named by the PR description, which weakens confidence that the regenerated output corresponds to the stated source.

src/models/organization_membership.rs, src/models/user_organization_membership.rs, .last-synced-sha

T-Rex T-Rex Logs

What T-Rex did

  • Compared the base worktree against the current roles fixtures to establish the initial state before changes.
  • Ran head validation after updating fixtures; the results show roles fixture/model support is present but last-synced-sha mismatched, causing EXIT_CODE: 1.
  • Verified that no live WorkOS API calls were made; this exercise used only local SDK contract files and fixtures relevant to the generated model/API serialization contract.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. General comment

    P2 .last-synced-sha does not match the OpenAPI spec SHA named by the PR

    • Bug
      • The PR description says regeneration was triggered by workos/openapi-spec@053f61e, and the validation objective requires .last-synced-sha to equal that SHA. Runtime validation on head read .last-synced-sha=1a2f47b20f63f2c8f0eb56bbd2adb3b5947d693a, so the checked-in sync marker contradicts the stated generated source SHA.
    • Cause
      • The regenerated commit appears to have left .last-synced-sha at a different OpenAPI spec revision than the one referenced in the PR description/validation contract.
    • Fix
      • Update .last-synced-sha to 053f61e91f935b7602605a97e69c6db058ecabed if that is the actual spec revision used, or correct the PR/regeneration metadata and rerun generation from the intended OpenAPI spec commit.

    T-Rex Ran code and verified through T-Rex

Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
src/models/organization_membership.rs:35
**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.

### Issue 2 of 2
src/models/user_organization_membership.rs:35
**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.

Reviews (1): Last reviewed commit: "chore(generated): add release notes frag..." | Re-trigger Greptile

/// 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>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 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>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 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.

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

Development

Successfully merging this pull request may close these issues.

0 participants