Skip to content

Commit

Permalink
fix: body check error
Browse files Browse the repository at this point in the history
  • Loading branch information
wangkedi.cody committed Feb 25, 2022
1 parent ef64138 commit 179541b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/decorators.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import is from 'is-type-of';
import { curry, toLower } from 'ramda';
import { curry, toLower, clone } from 'ramda';
import swaggerObject from './swaggerObject';

const _desc = (type: string, text: string | any[]) => (
Expand All @@ -14,11 +14,12 @@ const _desc = (type: string, text: string | any[]) => (
};

const _stripInvalidStructureFieldsFromBodyParams = (parameters: { [name: string]: any }) => {
const keys = Object.keys(parameters);
const p = clone(parameters);
const keys = Object.keys(p);
for (const key of keys) {
delete parameters[key].required;
delete p[key].required;
}
return parameters;
return p;
};

const _params = (type: string, parameters: { [name: string]: any }) => (
Expand Down

0 comments on commit 179541b

Please sign in to comment.