Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('does not fail if some of the parameters are not decorated', () => {
class TestController {
@get('/greet')
greet(prefix: string, @param.query.string('message') message: string) {
return prefix + ': ' + message;
}
}
const spec = getControllerSpec(TestController);
const table = givenRoutingTable();
table.registerController(spec, TestController);
const paths = table.describeApiPaths();
const params = paths['/greet']['get'].parameters;
expect(params).to.have.property('length', 1);
expect(params[0]).to.have.properties({
name: 'message',
in: 'query',
schema: {type: 'string'},
});
});