petermcd / petermcd/monzo-api

v2 P4: Typed response models

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

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
36
Forks
7
Avg merge
4m
Merged PRs (30d)
2

Description

Part of the v2 roadmap (pillar P4 — largest surface area).

Extends the discipline the endpoint classes already apply to GET responses (typed properties over raw dicts) to everywhere a dict[str, Any] still leaks through — request payload construction, feed items, receipt items, webhook bodies.

Scope

  • Touches every endpoint's constructor and payload-building code.
  • Recommend stdlib dataclasses over adding a validation library (pydantic/attrs), to keep httpx as the only new dependency — worth confirming before implementation starts.

Flag: #90 (exposing Monzo's raw account_type string instead of the current incomplete enum) sits squarely inside this pillar's territory but has not been confirmed as in-scope. Needs an explicit yes/no before this starts, since typed-model work on Account will touch that field regardless.

Breaking: yes
Effort: L
Phase: beta

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 by reviewing the endpoint constructors and payload-building code described in the issue, then confirm whether stdlib dataclasses are appropriate and whether #90 is in scope. The work is done when the listed request payloads, feed and receipt items, webhook bodies, and remaining dict[str, Any] leaks use typed models, with the breaking changes accounted for.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.