Skip to content

Commit

Permalink
fix(validator): a bug where fastify omits hasOwnProperty in query obj
Browse files Browse the repository at this point in the history
SL-1251
  • Loading branch information
Chris Miaskowski committed Jan 25, 2019
1 parent dfd555b commit 726fcff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/http/src/validator/validators/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class HttpParamsValidator<Target, Spec extends IHttpParam>
public validate(target: Target, specs: Spec[], mediaType?: string): IValidation[] {
const { _registry: registry, _prefix: prefix, _style: style } = this;
return specs.reduce<IValidation[]>((results, spec) => {
if (!target.hasOwnProperty(spec.name) && spec.required === true) {
if (!(spec.name in target) && spec.required === true) {
results.push({
path: [prefix, spec.name],
name: 'required',
Expand Down

0 comments on commit 726fcff

Please sign in to comment.