-
Notifications
You must be signed in to change notification settings - Fork 87
Refine User Sharing v2 request DOs for GET and PATCH #590
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
Refine User Sharing v2 request DOs for GET and PATCH #590
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #590 +/- ##
=========================================
Coverage 53.18% 53.19%
Complexity 2160 2160
=========================================
Files 213 213
Lines 13327 13325 -2
Branches 2195 2195
=========================================
Hits 7088 7088
+ Misses 5551 5549 -2
Partials 688 688
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull request overview
This PR refactors the User Sharing v2 request data objects (DOs) to enhance API-layer/Jackson deserialization support and standardize PATCH operation models. The changes include adding constructors to support framework binding, renaming classes for better clarity, and updating service layer method signatures to use the new model types.
Key Changes:
- Added no-args and minimal constructors to request DOs (
GetUserSharedOrgsDO,PatchOperationDO) for Jackson deserialization support - Refactored PATCH models by renaming
PatchUserShareDO→UserSharePatchDO,RoleAssignmentUpdateDO→PatchOperationDO, andRoleAssignmentOperation→UserSharePatchOperation - Updated service interface and implementation to use the new
UserSharePatchDOtype and corrected exception types fromOrganizationManagementExceptiontoUserSharingMgtException
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| UserSharePatchDO.java | New PATCH request model extending BaseUserShareDO with patchOperations field |
| PatchUserShareDO.java | Deleted old PATCH model in favor of the new UserSharePatchDO |
| PatchOperationDO.java | Renamed from RoleAssignmentUpdateDO, added no-args constructor for deserialization |
| UserSharePatchOperation.java | Renamed enum from RoleAssignmentOperation for better naming clarity |
| GetUserSharedOrgsDO.java | Added no-args and minimal constructors for framework binding support |
| UserSharingPolicyHandlerServiceV2.java | Updated method signature to use UserSharePatchDO and corrected exception types in Javadoc |
| UserSharingPolicyHandlerServiceImplV2.java | Updated implementation method signature to match interface changes |
Comments suppressed due to low confidence (1)
components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/models/dos/PatchOperationDO.java:33
- According to the custom coding guidelines, all public methods should have a docstring. The no-args constructor should include a Javadoc comment explaining its purpose, such as being used for Jackson deserialization or framework binding.
...entity/organization/management/organization/user/sharing/models/dos/GetUserSharedOrgsDO.java
Show resolved
Hide resolved
...entity/organization/management/organization/user/sharing/models/dos/GetUserSharedOrgsDO.java
Show resolved
Hide resolved
.../identity/organization/management/organization/user/sharing/models/dos/UserSharePatchDO.java
Show resolved
Hide resolved
Codecov fails because this PR is scaffold-only (new models/skeleton code) and no tests or runnable paths were added yet to cover these new lines. Coverage will be added with the upcoming implementation PR(s). |
b74b24f
into
wso2-extensions:main
Purpose
Update the User Sharing v2 request models to better support API-layer/Jackson deserialization and standardize PATCH role-update inputs, while keeping service contracts consistent.
Goals
GetUserSharedOrgsDO,PatchOperationDO).UserSharePatchDO+PatchOperationDO) and a clearer operation enum (UserSharePatchOperation).UserSharingPolicyHandlerServiceV2andUserSharingPolicyHandlerServiceImplV2to accept the new PATCH DO type.Approach
GetUserSharedOrgsDOwith a default constructor and a minimal (userId, parentOrgId) constructor in addition to the full constructor.PatchOperationDO(fromRoleAssignmentUpdateDO) and switch operation type toUserSharePatchOperation.UserSharePatchOperation(fromRoleAssignmentOperation) while keeping supported operations (add,remove) andfromValue.UserSharePatchDOas the request container withList<PatchOperationDO> patchOperations(and setters/getters for binding).UserSharePatchDO(and align Javadoc accordingly).Related PRs
Related Issues