From ff49c8342ae8a66802d505e1b0a890296bb39442 Mon Sep 17 00:00:00 2001 From: typosaurus Date: Sun, 26 Jul 2026 23:18:17 +0000 Subject: [PATCH] feat(nadia): Update API documentation for profile endpoints with new response fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Outcome: done Changed: `devplacepy/docs_api/groups/profiles.py:44,48` — updated summary to mention `xp_next_level` and `xp_progress_pct`; added notes documenting the formula. Verified by: `python3 -m py_compile devplacepy/docs_api/groups/profiles.py` — pass. Findings: - `ProfileOut` already declared `xp_next_level: int = 0` and `xp_progress_pct: int = 0` (schemas/profile.py:77-78) - `UserOut` already declared `xp_progress_pct: Optional[int] = None` and `xp_next_level: Optional[int] = None` (schemas/content.py:20-21) - The `profile-detail` endpoint sample response is auto-generated from `ProfileOut` via `schema_example()` (negotiation.py:37), so the new fields appear automatically in the sample response without manual edit - Documentation summary (profiles.py:44) now lists `xp_next_level` and `xp_progress_pct` as JSON-exposed fields - Documentation notes (profiles.py:48) state the formula: `xp_next_level = level * 100`, `xp_progress_pct = xp % 100`, and note both are also embedded in `profile_user` Open: none Confidence: high — single targeted edit, syntax-compiled clean, matches existing doc conventions Typosaurus-Run: a6697d32c4ea49b4a9767bd5a8c1119f Typosaurus-Node: a445e4e802ac4d95b69169b1a4e34185 Typosaurus-Agent: @nadia Refs: #112 --- devplacepy/docs_api/groups/profiles.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devplacepy/docs_api/groups/profiles.py b/devplacepy/docs_api/groups/profiles.py index 7ebdb25c..03bf8dea 100644 --- a/devplacepy/docs_api/groups/profiles.py +++ b/devplacepy/docs_api/groups/profiles.py @@ -41,9 +41,12 @@ four ways to sign requests. method="GET", path="/profile/{username}", title="View a profile", - summary="Render a user profile, including an online-presence indicator (JSON exposes profile_online and profile_user.last_seen). Returns an HTML page.", + summary="Render a user profile, including an online-presence indicator (JSON exposes profile_online, profile_user.last_seen, xp_next_level, and xp_progress_pct). Returns an HTML page.", auth="public", interactive=True, + notes=[ + "Level progress: `xp_next_level = level * 100` (total XP needed), `xp_progress_pct = xp % 100` (percentage towards next level). Both are also embedded in `profile_user`.", + ], params=[ field( "username", @@ -793,3 +796,4 @@ four ways to sign requests. ), ], } +