|
2 | 2 | "openapi": "3.0.3", |
3 | 3 | "info": { |
4 | 4 | "title": "Rihla backend APIs", |
5 | | - "description": "OpenAPI documentation. Friends service runs on port 4003 (host) or `friends:4003` inside Docker Compose.\n\n**WebSocket chat** (port 8181 by default) is in `friends-chat.asyncapi.yaml`. **Notification WebSocket** (port 8182 by default) is in `friends-notifications.asyncapi.yaml`. Open either file from this folder in [AsyncAPI Studio](https://studio.asyncapi.com/) (File → Load file), or mount the same directory in any AsyncAPI viewer.", |
| 5 | + "description": "OpenAPI documentation. Friends service runs on port 4003 (host) or `friends:4003` inside Docker Compose. HTTP REST is mounted at **`/api/friends`**, **`/api/chat`**, and **`/api/notifications`** (see paths below).\n\n**WebSocket chat** (port 8181 by default) is in `friends-chat.asyncapi.yaml`. **Notification WebSocket** (port 8182 by default) is in `friends-notifications.asyncapi.yaml`. Open either file from this folder in [AsyncAPI Studio](https://studio.asyncapi.com/) (File → Load file), or mount the same directory in any AsyncAPI viewer.", |
6 | 6 | "version": "1.0.0" |
7 | 7 | }, |
8 | 8 | "servers": [ |
|
22 | 22 | }, |
23 | 23 | { |
24 | 24 | "name": "Chat", |
25 | | - "description": "Direct messages between friends (friends-service, `/chat`)" |
| 25 | + "description": "Direct messages between friends (friends-service, `/api/chat`)" |
26 | 26 | }, |
27 | 27 | { |
28 | 28 | "name": "Notifications", |
29 | | - "description": "In-app notifications (friends-service, `/notifications`); real-time delivery on WebSocket port 8182" |
| 29 | + "description": "In-app notifications (friends-service, `/api/notifications`); real-time delivery on WebSocket port 8182" |
30 | 30 | } |
31 | 31 | ], |
32 | 32 | "components": { |
|
188 | 188 | }, |
189 | 189 | "Notification": { |
190 | 190 | "type": "object", |
191 | | - "description": "Persisted row; `GET /notifications` omits archived notifications.", |
| 191 | + "description": "Persisted row; `GET /api/notifications` omits archived notifications.", |
192 | 192 | "properties": { |
193 | 193 | "id": { "type": "string", "description": "Cuid" }, |
194 | 194 | "userId": { "type": "string" }, |
|
231 | 231 | } |
232 | 232 | }, |
233 | 233 | "paths": { |
234 | | - "/friends": { |
| 234 | + "/api/friends": { |
235 | 235 | "get": { |
236 | 236 | "tags": ["Friends"], |
237 | 237 | "summary": "List friends", |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | }, |
273 | | - "/friends/{userId}": { |
| 273 | + "/api/friends/{userId}": { |
274 | 274 | "get": { |
275 | 275 | "tags": ["Friends"], |
276 | 276 | "summary": "Get one friend", |
|
354 | 354 | } |
355 | 355 | } |
356 | 356 | }, |
357 | | - "/friends/requests/incoming": { |
| 357 | + "/api/friends/requests/incoming": { |
358 | 358 | "get": { |
359 | 359 | "tags": ["Friends"], |
360 | 360 | "summary": "List incoming friend requests", |
|
392 | 392 | } |
393 | 393 | } |
394 | 394 | }, |
395 | | - "/friends/requests/outgoing": { |
| 395 | + "/api/friends/requests/outgoing": { |
396 | 396 | "get": { |
397 | 397 | "tags": ["Friends"], |
398 | 398 | "summary": "List outgoing friend requests", |
|
430 | 430 | } |
431 | 431 | } |
432 | 432 | }, |
433 | | - "/friends/requests": { |
| 433 | + "/api/friends/requests": { |
434 | 434 | "post": { |
435 | 435 | "tags": ["Friends"], |
436 | 436 | "summary": "Send friend request", |
|
492 | 492 | } |
493 | 493 | } |
494 | 494 | }, |
495 | | - "/friends/requests/{requestId}/accept": { |
| 495 | + "/api/friends/requests/{requestId}/accept": { |
496 | 496 | "post": { |
497 | 497 | "tags": ["Friends"], |
498 | 498 | "summary": "Accept friend request", |
|
534 | 534 | } |
535 | 535 | } |
536 | 536 | }, |
537 | | - "/friends/requests/{requestId}": { |
| 537 | + "/api/friends/requests/{requestId}": { |
538 | 538 | "delete": { |
539 | 539 | "tags": ["Friends"], |
540 | 540 | "summary": "Cancel or decline friend request", |
|
577 | 577 | } |
578 | 578 | } |
579 | 579 | }, |
580 | | - "/chat/conversations": { |
| 580 | + "/api/chat/conversations": { |
581 | 581 | "get": { |
582 | 582 | "tags": ["Chat"], |
583 | 583 | "summary": "List my conversations", |
|
674 | 674 | } |
675 | 675 | } |
676 | 676 | }, |
677 | | - "/chat/conversations/{conversationId}/messages": { |
| 677 | + "/api/chat/conversations/{conversationId}/messages": { |
678 | 678 | "get": { |
679 | 679 | "tags": ["Chat"], |
680 | 680 | "summary": "List messages in a conversation", |
|
813 | 813 | } |
814 | 814 | } |
815 | 815 | }, |
816 | | - "/notifications": { |
| 816 | + "/api/notifications": { |
817 | 817 | "get": { |
818 | 818 | "tags": ["Notifications"], |
819 | 819 | "summary": "List notifications", |
|
852 | 852 | } |
853 | 853 | } |
854 | 854 | }, |
855 | | - "/notifications/read": { |
| 855 | + "/api/notifications/read": { |
856 | 856 | "patch": { |
857 | 857 | "tags": ["Notifications"], |
858 | 858 | "summary": "Mark one notification read", |
|
913 | 913 | } |
914 | 914 | } |
915 | 915 | }, |
916 | | - "/notifications/readAll": { |
| 916 | + "/api/notifications/readAll": { |
917 | 917 | "patch": { |
918 | 918 | "tags": ["Notifications"], |
919 | 919 | "summary": "Mark all notifications read", |
|
949 | 949 | } |
950 | 950 | } |
951 | 951 | }, |
952 | | - "/notifications/archive": { |
| 952 | + "/api/notifications/archive": { |
953 | 953 | "patch": { |
954 | 954 | "tags": ["Notifications"], |
955 | 955 | "summary": "Archive a notification", |
956 | | - "description": "Hides the row from `GET /notifications` and emits `notification_archived` on the notification WebSocket. Query `id` required.", |
| 956 | + "description": "Hides the row from `GET /api/notifications` and emits `notification_archived` on the notification WebSocket. Query `id` required.", |
957 | 957 | "security": [{ "bearerAuth": [] }], |
958 | 958 | "parameters": [ |
959 | 959 | { |
|
0 commit comments