Skip to content

Commit f0017e1

Browse files
fix: address code review feedback
- Add comment clarifying empty path for notification list endpoint - Remove misleading bodyTemplate from file upload endpoint - Use toBeGreaterThanOrEqual in tests for catalog size assertions Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/35c2f5ae-4b72-4579-aab2-f9d563e61689 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
1 parent 955fb7b commit f0017e1

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/studio/src/hooks/use-api-discovery.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export const SERVICE_ENDPOINT_CATALOG: Record<string, { group: string; defaultRo
110110
group: 'Notifications',
111111
defaultRoute: '/api/v1/notifications',
112112
endpoints: [
113-
{ method: 'GET', path: '', desc: 'List notifications' },
113+
{ method: 'GET', path: '', desc: 'List notifications' }, // empty path → hits the base route prefix
114114
{ method: 'POST', path: '/devices', desc: 'Register device for push', bodyTemplate: { token: '', platform: 'web' } },
115115
{ method: 'DELETE', path: '/devices/:deviceId', desc: 'Unregister device' },
116116
{ method: 'GET', path: '/preferences', desc: 'Get notification preferences' },
@@ -166,7 +166,7 @@ export const SERVICE_ENDPOINT_CATALOG: Record<string, { group: string; defaultRo
166166
group: 'Storage',
167167
defaultRoute: '/api/v1/storage',
168168
endpoints: [
169-
{ method: 'POST', path: '/upload', desc: 'Upload file', bodyTemplate: {} },
169+
{ method: 'POST', path: '/upload', desc: 'Upload file (multipart/form-data)' },
170170
{ method: 'GET', path: '/:fileId', desc: 'Download file' },
171171
{ method: 'DELETE', path: '/:fileId', desc: 'Delete file' },
172172
],

apps/studio/test/service-endpoint-catalog.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('buildServiceEndpoints', () => {
8383

8484
it('should build workflow endpoints correctly', () => {
8585
const endpoints = buildServiceEndpoints('workflow', '/api/v1/workflow');
86-
expect(endpoints.length).toBe(5);
86+
expect(endpoints.length).toBeGreaterThanOrEqual(5);
8787

8888
const methods = endpoints.map(e => e.method);
8989
expect(methods).toContain('GET');
@@ -96,7 +96,7 @@ describe('buildServiceEndpoints', () => {
9696

9797
it('should build notification endpoints correctly', () => {
9898
const endpoints = buildServiceEndpoints('notification', '/api/v1/notifications');
99-
expect(endpoints.length).toBe(7);
99+
expect(endpoints.length).toBeGreaterThanOrEqual(7);
100100

101101
// Should include list notifications at base path
102102
const listEp = endpoints.find(e => e.path === '/api/v1/notifications' && e.method === 'GET');

0 commit comments

Comments
 (0)