Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dull-peaches-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wormajs": patch
---

fix: 生成的aidocs不包含Query Parameters
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions packages/worma/test/plugins/aiDoc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,18 @@ 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'),
'utf-8',
)
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 () => {
Expand Down
Loading