feat(generated): OrganizationMembership (batch 4a353f07)#676
Open
workos-sdk-automation[bot] wants to merge 2 commits into
Open
feat(generated): OrganizationMembership (batch 4a353f07)#676workos-sdk-automation[bot] wants to merge 2 commits into
workos-sdk-automation[bot] wants to merge 2 commits into
Conversation
Contributor
Greptile SummaryThis PR regenerates SDK models from the latest spec. The main changes are:
Confidence Score: 3/5The generated membership deserializer can reject successful responses that still use the legacy singular role shape.
src/workos/organization_membership/models/organization_membership.py
What T-Rex did
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
src/workos/organization_membership/models/organization_membership.py:65-68
**Legacy Role Payloads Fail**
When an existing membership response or mock payload still has only `role`, this required `data["roles"]` lookup raises during `from_dict`. The membership resource methods deserialize successful API responses through this path, so callers can receive an unexpected SDK error instead of an `OrganizationMembership` model.
Reviews (1): Last reviewed commit: "chore(generated): add release notes frag..." | Re-trigger Greptile |
Comment on lines
+65
to
+68
| roles=[ | ||
| SlimRole.from_dict(cast(Dict[str, Any], item)) | ||
| for item in cast(list[Any], data["roles"]) | ||
| ], |
Contributor
There was a problem hiding this comment.
When an existing membership response or mock payload still has only role, this required data["roles"] lookup raises during from_dict. The membership resource methods deserialize successful API responses through this path, so callers can receive an unexpected SDK error instead of an OrganizationMembership model.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/workos/organization_membership/models/organization_membership.py
Line: 65-68
Comment:
**Legacy Role Payloads Fail**
When an existing membership response or mock payload still has only `role`, this required `data["roles"]` lookup raises during `from_dict`. The membership resource methods deserialize successful API responses through this path, so callers can receive an unexpected SDK error instead of an `OrganizationMembership` model.
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Regenerated SDK from spec changes.
Triggered by workos/openapi-spec@053f61e