Skip to content

Commit

Permalink
fix(crud): fixed swagger query params metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelyali committed Jun 27, 2019
1 parent d8b279a commit 964f35c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/crud/src/crud/swagger.helper.ts
@@ -1,5 +1,5 @@
import { HttpStatus } from '@nestjs/common';
import { objKeys } from '@nestjsx/util';
import { objKeys, isString } from '@nestjsx/util';
import { RequestQueryBuilder } from '@nestjsx/crud-request';

import { safeRequire } from '../util';
Expand Down Expand Up @@ -196,7 +196,10 @@ export class Swagger {

static getQueryParamsNames() {
const qbOptions = RequestQueryBuilder.getOptions();
const name = (n) => qbOptions.paramNamesMap[n][0];
const name = (n) => {
const selected = qbOptions.paramNamesMap[n];
return isString(selected) ? selected : selected[0];
};

return {
delim: qbOptions.delim,
Expand Down

0 comments on commit 964f35c

Please sign in to comment.