From a5c693d60b2b42f41b7faf5b0c03e9351eaa319e Mon Sep 17 00:00:00 2001 From: Lin Date: Thu, 15 Oct 2026 17:15:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E7=94=9F=E6=88=90=E7=9A=84aidocs?= =?UTF-8?q?=E4=B8=8D=E5=8C=85=E5=90=ABQuery=20Parameters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai-doc/references/{tag}/{api}.md.handlebars | 10 ++++++++++ packages/worma/test/plugins/aiDoc.spec.ts | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/packages/worma/src/template/presets/ai-doc/references/{tag}/{api}.md.handlebars b/packages/worma/src/template/presets/ai-doc/references/{tag}/{api}.md.handlebars index a1e550bb..ba8197ce 100644 --- a/packages/worma/src/template/presets/ai-doc/references/{tag}/{api}.md.handlebars +++ b/packages/worma/src/template/presets/ai-doc/references/{tag}/{api}.md.handlebars @@ -27,6 +27,16 @@ Pass the required parameters in `pathParams`: ``` {{/if}} +{{#if currentApi.queryParametersComment}} +## Query Parameters + +Pass the required query parameters in `params`: + +```typescript +{{{stripStarPrefix currentApi.queryParametersComment}}} +``` +{{/if}} + {{#if currentApi.requestBodyComment}} ## Request Body diff --git a/packages/worma/test/plugins/aiDoc.spec.ts b/packages/worma/test/plugins/aiDoc.spec.ts index cfa18e6b..ac6f4d03 100644 --- a/packages/worma/test/plugins/aiDoc.spec.ts +++ b/packages/worma/test/plugins/aiDoc.spec.ts @@ -247,6 +247,9 @@ describe('plugins/aiDoc', () => { expect(listPetsContent).toContain('/pets') // Should show file location, not import statement expect(listPetsContent).toContain('is located at') + // Query parameters should be documented in their own section + expect(listPetsContent).toContain('Query Parameters') + expect(listPetsContent).toContain('limit: number of items') const createPetContent = readVolFile( resolve(aidocsDir, 'references', 'pets', 'createPet.md'), @@ -254,6 +257,8 @@ describe('plugins/aiDoc', () => { ) expect(createPetContent).toContain('Create a pet') expect(createPetContent).toContain('[POST]') + // APIs without query parameters must not render the section + expect(createPetContent).not.toContain('Query Parameters') }) it('should respect custom outputDir option', async () => { From 7f4d8ea416b2828d3acb6ac35c758e6500c6c8f9 Mon Sep 17 00:00:00 2001 From: Ignorance <50456320+mudyyy@users.noreply.github.com> Date: Thu, 15 Oct 2026 17:36:27 +0800 Subject: [PATCH 2/2] Create dull-peaches-press.md --- .changeset/dull-peaches-press.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/dull-peaches-press.md diff --git a/.changeset/dull-peaches-press.md b/.changeset/dull-peaches-press.md new file mode 100644 index 00000000..326e1102 --- /dev/null +++ b/.changeset/dull-peaches-press.md @@ -0,0 +1,5 @@ +--- +"wormajs": patch +--- + +fix: 生成的aidocs不包含Query Parameters