Skip to content

Commit 44bfd7e

Browse files
authored
fix: incorrect generation "deprecated" jsdoc for method (#111)
1 parent e81acc7 commit 44bfd7e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/language/typescript/2.0/serializers/operation-object.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import {
5252
SerializedFragment,
5353
} from '../../common/data/serialized-fragment';
5454
import { sequenceOptionEither } from '../../../../utils/option';
55+
import { identity } from 'fp-ts/lib/function';
5556

5657
interface Parameters {
5758
readonly pathParameters: PathParameterObject[];
@@ -246,6 +247,7 @@ export const serializeOperationObject = combineReader(
246247

247248
const deprecated = pipe(
248249
operation.deprecated,
250+
option.filter(identity),
249251
map(() => `@deprecated`),
250252
);
251253

test/specs/2.0/json/swagger.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"tags": [
5050
"pet"
5151
],
52+
"deprecated": false,
5253
"summary": "Add a new pet to the store",
5354
"description": "",
5455
"operationId": "addPet",
@@ -149,6 +150,7 @@
149150
"tags": [
150151
"pet"
151152
],
153+
"deprecated": true,
152154
"summary": "Finds Pets by status",
153155
"description": "Multiple status values can be provided with comma separated strings",
154156
"operationId": "findPetsByStatus",

0 commit comments

Comments
 (0)