Skip to content
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

Make light versions of response objects more explicit #1084

Open
mkorniluk-veepee opened this issue Feb 1, 2024 · 1 comment
Open

Make light versions of response objects more explicit #1084

mkorniluk-veepee opened this issue Feb 1, 2024 · 1 comment

Comments

@mkorniluk-veepee
Copy link

There are several cases of bulk queries that return 'lighter' versions of objects. For example mergeRequestApi.getMergeRequests() returns a list MergeRequest objects that contain only basic info. The class provides accessors to get approvals, changes, etc. but they are null unless queried using other calls (using mergeRequestApi.getApprovals() for approvals for example).

Would it be possible to make this more explicit in 6.0.0? For example make mergeRequestApi.getMergeRequests() return a list of another type (let's call it BasicMergeRequest) that contains only the info that is actually available for this call.

@jmini
Copy link
Collaborator

jmini commented Feb 2, 2024

Yes this is possible. We have this pattern at a lot of places.

The best is to have a parent class containing only the common fields.

Have a look at AbstractUser or AbstractGroup where we use already this pattern.

Could you create a pull request? or at least identify the attributes that are only present in getMergeRequests()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants