Skip to content

Commit

Permalink
fix(generators): response type when no content to void
Browse files Browse the repository at this point in the history
  • Loading branch information
anymaniax committed Aug 31, 2021
1 parent 4580f74 commit a674cf1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/core/generators/componentDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const generateComponentDefinition = (
[[suffix, response]],
name,
context,
'void',
);

const imports = allResponseTypes.reduce<GeneratorImport[]>(
Expand Down
5 changes: 3 additions & 2 deletions src/core/getters/resReqTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const getResReqTypes = async (
>,
name: string,
context: ContextSpecs,
defaultType = 'unknown',
): Promise<ResReqTypesValue[]> => {
const typesArray = await Promise.all(
responsesOrRequests
Expand Down Expand Up @@ -151,10 +152,10 @@ export const getResReqTypes = async (

return [
{
value: 'unknown',
value: defaultType,
imports: [],
schemas: [],
type: 'unknown',
type: defaultType,
isEnum: false,
key,
},
Expand Down
1 change: 1 addition & 0 deletions src/core/getters/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const getResponse = async (
Object.entries(responses),
operationId,
context,
'void',
);

const groupedByStatus = types.reduce<{
Expand Down

0 comments on commit a674cf1

Please sign in to comment.