Skip to content

Commit 4e763a9

Browse files
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

File tree

api/swagger/swagger-v1.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8181,14 +8181,14 @@ paths:
81818181
"500":
81828182
description: Server error
81838183
content: {}
8184-
/notifications/{user_id}:
8184+
/notifications/{id}:
81858185
get:
81868186
tags:
81878187
- notifications
81888188
description: Get notifications for user ID
81898189
operationId: Get Notifications
81908190
parameters:
8191-
- name: user_id
8191+
- name: id
81928192
in: path
81938193
description: A User ID
81948194
required: true
@@ -8199,8 +8199,8 @@ paths:
81998199
description:
82008200
The user ID of the user making the request. Required for
82018201
personalization of related users (e.g. does_current_user_follow)
8202-
in the response, and may differ from the path user_id when a
8203-
manager is reading a managed user's notifications.
8202+
in the response, and may differ from the path id when a manager
8203+
is reading a managed user's notifications.
82048204
schema:
82058205
type: string
82068206
- name: timestamp
@@ -8281,7 +8281,7 @@ paths:
82818281
application/json:
82828282
schema:
82838283
$ref: "#/components/schemas/notifications_response"
8284-
/notifications/{user_id}/playlist_updates:
8284+
/notifications/{id}/playlist_updates:
82858285
get:
82868286
tags:
82878287
- notifications
@@ -8290,7 +8290,7 @@ paths:
82908290
ID
82918291
operationId: Get Playlist Updates
82928292
parameters:
8293-
- name: user_id
8293+
- name: id
82948294
in: path
82958295
description: A User ID
82968296
required: true
@@ -8301,8 +8301,8 @@ paths:
83018301
description:
83028302
The user ID of the user making the request. Required for
83038303
personalization of related users (e.g. does_current_user_follow)
8304-
in the response, and may differ from the path user_id when a
8305-
manager is reading a managed user's playlist updates.
8304+
in the response, and may differ from the path id when a manager
8305+
is reading a managed user's playlist updates.
83068306
schema:
83078307
type: string
83088308
responses:

0 commit comments

Comments
 (0)