Skip to content

Commit

Permalink
fix return type w/out refs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiri111enz authored and v8tenko committed Jan 30, 2024
1 parent f2cedd9 commit 1db1ce8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/__snapshots__/examples/array.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ Generated server url{.openapi__request__description}
#||| **Name** | **Type** | **Description** ||
|| a | string
or integer[] | |||#
|| a | (string
or integer)[] | |||#
## Responses
Expand Down
5 changes: 4 additions & 1 deletion src/includer/traverse/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ export function prepareTableRowData(
};
}

const returnType = (inner.ref?.length || 0) <= 1 ? `${inner.type}[]` : `(${inner.type})[]`;
const returnType =
(inner.ref?.length || inner.type.split('\n').length || 0) <= 1
? `${inner.type}[]`
: `(${inner.type})[]`;

return {
type: returnType,
Expand Down

0 comments on commit 1db1ce8

Please sign in to comment.