mollie / mollie/mollie-api-python
Refactor `ObjectList` implementation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 127
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
Problem
The current Objectlist (the object that wraps a collection of API results, f.i. "get payments") is a messy class.
- It supports some methods that make it behave as a list, but also some dictionary-like behaviors.
- Iterating over paginated results is something that a developer must do in code, it is not provided by the client.
- It is initialized using a complex data structure (a full API response) which makes the code handling this data hard to read
Improvements
- Consume only the list data from the API response (Also see the TODO in code: https://github.com/mollie/mollie-api-python/blob/5b63136b4a7f5543ded9fb4141b7b6feaaada7a1/mollie/api/objects/list.py#L17-L19)
- Automatic iteration over paginated API results
- Expose only list behavior
In #285 a POC is available. This should be properly integrated and tested.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with mollie/api/objects/list.py, especially the TODO linked in the issue, and review the proof of concept in #285. Trace the current API response handling and pagination behavior, then verify that the integrated object consumes list data, iterates paginated results automatically, exposes only list behavior, and has tests for these changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100