Skip to content

Commit

Permalink
fix(queryparams): definition name
Browse files Browse the repository at this point in the history
  • Loading branch information
anymaniax committed Jun 30, 2020
1 parent cb04603 commit 65193c2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion src/core/getters/queryParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const getQueryParams = (
(acc, { schemas = [] }) => [...acc, ...schemas],
[],
);
const name = `${definitionName}Params`;
const name = `${pascal(definitionName)}Params`;

const type = types.map(({ definition }) => definition).join('; ');

Expand Down
7 changes: 0 additions & 7 deletions src/core/getters/scalar.mock.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { SchemaObject } from 'openapi3-ts';
import { MockOptions } from '../../types';
import { MockDefinition } from '../../types/mocks';
import { pascal } from '../../utils/case';
import { resolveMockValue } from '../resolvers/value.mock';
import { getMockObject } from './object.mock';

Expand Down Expand Up @@ -128,12 +127,6 @@ export const getMockScalar = ({
imports = [item.name];
}

if (!item.isRef && item.parents) {
const enumName = pascal([...item.parents, item.name].join(' '));
enumValue = `Object.values(${enumName})`;
imports = [enumName];
}

value = `faker.helpers.randomize(${enumValue})`;
}

Expand Down

0 comments on commit 65193c2

Please sign in to comment.