Skip to content

Commit

Permalink
fix: 优化生成注释顺序
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Jul 15, 2024
1 parent 6ad5541 commit 694ac7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/printer/JsDoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export class JsDoc {
static fromSchema(schema: OpenApi3.SchemaObject) {
const { deprecated, description, default: defaultValue, format, example, title, externalDocs } = schema;
return {
description,
summary: title,
description,
deprecated,
default: defaultValue,
format,
Expand Down
6 changes: 4 additions & 2 deletions test/printer/v31.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ test('v3.1 schema', () => {
schemas: {
Category: {
$id: 'my-id',
description: 'Category',
title: 'Category Title',
description: 'Category Description',
properties: {
id: {
type: 'integer',
Expand Down Expand Up @@ -50,7 +51,8 @@ test('v3.1 schema', () => {
}),
).toMatchInlineSnapshot(`
"/**
* @description Category
* @summary Category Title
* @description Category Description
*/
export type Category = {
/**
Expand Down

0 comments on commit 694ac7f

Please sign in to comment.