mollie / mollie/mollie-api-python

Refactor `ObjectList` implementation

Open
#278 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

In #285 a POC is available. This should be properly integrated and tested.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.