feat(web): 分类展示公开 API 文档
将通用开放接口与兼容接口分层展示,补充完整接口目录、分类路由、搜索能力和接入约定。\n\n验证:pnpm nx run web:test;pnpm nx run web:build
This commit is contained in:
@@ -3,6 +3,12 @@ import { parseAppRoute, pathForApiDocSection } from './routing';
|
||||
|
||||
describe('API documentation routes', () => {
|
||||
it.each([
|
||||
['openApiOverview', '/docs/open-api'],
|
||||
['compatApiOverview', '/docs/compatible-api'],
|
||||
['compatGemini', '/docs/compatible-api/gemini'],
|
||||
['compatKling', '/docs/compatible-api/kling'],
|
||||
['compatVolces', '/docs/compatible-api/volces'],
|
||||
['compatServerMain', '/docs/compatible-api/server-main'],
|
||||
['guideBaseUrl', '/docs/auth'],
|
||||
['guideWebhook', '/docs/webhook'],
|
||||
['guideErrors', '/docs/errors'],
|
||||
@@ -24,4 +30,8 @@ describe('API documentation routes', () => {
|
||||
] as const)('keeps the legacy documentation URL %s working', (path, section) => {
|
||||
expect(parseAppRoute(path).apiDocSection).toBe(section);
|
||||
});
|
||||
|
||||
it('uses the common open API catalog as the documentation landing page', () => {
|
||||
expect(parseAppRoute('/docs').apiDocSection).toBe('openApiOverview');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user