Commit 4e763a9
docs(swagger): rename notifications path placeholder user_id -> id (#838)
## Summary
Rename the OpenAPI path placeholder on the two notifications routes from
`{user_id}` to `{id}`, matching the convention used by every
`/users/{id}/...` route. Concrete URL is unchanged.
- `/notifications/{user_id}` → `/notifications/{id}`
- `/notifications/{user_id}/playlist_updates` →
`/notifications/{id}/playlist_updates`
## Why
Follow-up to #837, which added a `user_id` query parameter to both
routes for personalization of embedded `related.users`. With the path
placeholder *also* named `user_id`, `openapi-generator`
(typescript-fetch) emitted a colliding TS field (`userId2`) in the
generated `GetNotificationsRequest` / `GetPlaylistUpdatesRequest`. The
wire format was correct but the public SDK type surface was awkward.
Renaming the path placeholder to `id` lets the generator produce a clean
shape:
```ts
GetNotificationsRequest { id: string; userId?: string; ... }
```
The Fiber router matches `/notifications/:userId` by position, not by
name, so no Go change is required and the concrete URL clients send is
unchanged.
## Breaking change
This **is** a breaking change for external `@audius/sdk` consumers of
`getNotifications` / `getPlaylistUpdates`: the path field renames from
`userId` to `id`. Server behaviour, wire format, and URL paths are
unchanged.
In-monorepo call sites will be updated in the corresponding apps PR
([AudiusProject/apps#14366](AudiusProject/apps#14366))
after this merges.
## Test plan
- [x] Spec validates in CI.
- [x] Hitting `/notifications/<hashed-id>?user_id=<hashed-id>`
post-deploy returns the same response as before.
- [x] Regenerating the apps SDK against the merged spec produces a clean
`GetNotificationsRequest` with `id` (path) and `userId` (query), no
`userId2`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent db7afc5 commit 4e763a9
1 file changed
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8181 | 8181 | | |
8182 | 8182 | | |
8183 | 8183 | | |
8184 | | - | |
| 8184 | + | |
8185 | 8185 | | |
8186 | 8186 | | |
8187 | 8187 | | |
8188 | 8188 | | |
8189 | 8189 | | |
8190 | 8190 | | |
8191 | | - | |
| 8191 | + | |
8192 | 8192 | | |
8193 | 8193 | | |
8194 | 8194 | | |
| |||
8199 | 8199 | | |
8200 | 8200 | | |
8201 | 8201 | | |
8202 | | - | |
8203 | | - | |
| 8202 | + | |
| 8203 | + | |
8204 | 8204 | | |
8205 | 8205 | | |
8206 | 8206 | | |
| |||
8281 | 8281 | | |
8282 | 8282 | | |
8283 | 8283 | | |
8284 | | - | |
| 8284 | + | |
8285 | 8285 | | |
8286 | 8286 | | |
8287 | 8287 | | |
| |||
8290 | 8290 | | |
8291 | 8291 | | |
8292 | 8292 | | |
8293 | | - | |
| 8293 | + | |
8294 | 8294 | | |
8295 | 8295 | | |
8296 | 8296 | | |
| |||
8301 | 8301 | | |
8302 | 8302 | | |
8303 | 8303 | | |
8304 | | - | |
8305 | | - | |
| 8304 | + | |
| 8305 | + | |
8306 | 8306 | | |
8307 | 8307 | | |
8308 | 8308 | | |
| |||
0 commit comments