Skip to content

Commit 2cb7cb9

Browse files
author
t.chambard
committed
Apply changes after merge
1 parent b917025 commit 2cb7cb9

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

test/data/apis.ts

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
'use strict';
22

33
import {
4-
Accept, DELETE, FormParam, GET, Path,
5-
PathParam, POST, PUT, QueryParam,
4+
Accept, DELETE, FileParam, FormParam, GET,
5+
Path, PathParam, POST, PUT,
6+
QueryParam,
67
Return,
78
Security
89
} from 'typescript-rest';
@@ -402,25 +403,13 @@ export class ParameterizedEndpoint {
402403

403404
@Path('/file')
404405
@POST
405-
file(@FileParam('file') file: Express.Multer.File): PrimitiveClassModel {
406+
public file(@FileParam('file') file: Express.Multer.File): PrimitiveClassModel {
406407
return new PrimitiveClassModel();
407408
}
408409

409410
@Path('/stream')
410411
@POST
411-
stream(@swagger.StreamFileParam('stream') file: Express.Multer.File): PrimitiveClassModel {
412-
return new PrimitiveClassModel();
413-
}
414-
415-
@Path('/file')
416-
@POST
417-
file(@FileParam('file') file: Express.Multer.File): PrimitiveClassModel {
418-
return new PrimitiveClassModel();
419-
}
420-
421-
@Path('/stream')
422-
@POST
423-
stream(@swagger.StreamFileParam('stream') file: Express.Multer.File): PrimitiveClassModel {
412+
public stream(@swagger.StreamFileParam('stream') file: Express.Multer.File): PrimitiveClassModel {
424413
return new PrimitiveClassModel();
425414
}
426415
}

test/unit/definitions.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,22 +361,22 @@ describe('Definition generation', () => {
361361

362362
it('should generate formData param for params declared on method', () => {
363363
const expression = jsonata('paths."/parameterized/{objectId}/file".post.parameters[0].in');
364-
expect(expression.evaluate(spec)).to.eq('formData');
364+
expect(expression.evaluate(spec)).toEqual('formData');
365365
});
366366

367367
it('should generate path param for params declared on class', () => {
368368
const expression = jsonata('paths."/parameterized/{objectId}/stream".post.parameters[0].in');
369-
expect(expression.evaluate(spec)).to.eq('formData');
369+
expect(expression.evaluate(spec)).toEqual('formData');
370370
});
371371

372372
it('should generate formData param for params declared on method', () => {
373373
const expression = jsonata('paths."/parameterized/{objectId}/file".post.parameters[0].in');
374-
expect(expression.evaluate(spec)).to.eq('formData');
374+
expect(expression.evaluate(spec)).toEqual('formData');
375375
});
376376

377377
it('should generate path param for params declared on class', () => {
378378
const expression = jsonata('paths."/parameterized/{objectId}/stream".post.parameters[0].in');
379-
expect(expression.evaluate(spec)).to.eq('formData');
379+
expect(expression.evaluate(spec)).toEqual('formData');
380380
});
381381
});
382382

0 commit comments

Comments
 (0)