Skip to content

Commit

Permalink
fix: missing description
Browse files Browse the repository at this point in the history
  • Loading branch information
plantain-00 committed Jan 29, 2022
1 parent 6274df7 commit 6113ddd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion demo/cases.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"minimum": 1,
"default": 2,
"description": "pet id"
}
},
"description": "pet id"
},
{
"name": "sortType",
Expand Down
8 changes: 4 additions & 4 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1608,13 +1608,13 @@ export class Parser {
}
} else if (jsDoc.name === 'default') {
type.default = JSON.parse(this.getJsDocComment(jsDoc.comment))
} else if (jsDoc.name === 'title') {
type.title = jsDoc.comment
} else if (jsDoc.name === 'description') {
type.description = jsDoc.comment
}
} else if (jsDoc.name === 'uniqueItems') {
type.uniqueItems = true
} else if (jsDoc.name === 'title') {
type.title = jsDoc.comment
} else if (jsDoc.name === 'description') {
type.description = jsDoc.comment
}
}

Expand Down
1 change: 1 addition & 0 deletions src/swagger-doc-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function generateSwaggerDoc(context: Context, swaggerBase?: Record<string
in: useFormData ? 'formData' : parameter.in,
schema: useFormData ? undefined : schema,
type: useFormData ? schema.type : undefined,
description: useFormData ? undefined : parameter.type.description,
}
}),
summary: typeDeclaration.summary,
Expand Down

0 comments on commit 6113ddd

Please sign in to comment.