Skip to content

Two tests fail when trying to update swagger-parser dependency to address CVE-2021-3765 #736

Closed
@feenst

Description

@feenst

Issue

A component of the validator package is susceptible to CVE-2021-3765. This package is part of the dependency tree from hapi-swagger because of its dependency on swagger-parser 4.0.2.

When trying to raise a pull request to update to a newer version of swagger-parser as a dependency of hapi-swagger, two tests are failing.

Tests fail when trying to use the next available version of swagger-parser (4.1.0). You can see from the changelog here that version adds functionality to the validator, specifically validateRequiredPropertiesExist, which is why the tests are failing.

I'm still looking into this, but hoping from some insight from others on why the responses defined for the given tests are failing with the additional validation.

Environment

npx envinfo --npmPackages '*hapi*' --binaries

Binaries:
Node: 14.8.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - C:\Program Files\nodejs\yarn.CMD
npm: 6.14.7 - C:\Program Files\nodejs\npm.CMD

Steps to Reproduce

Expected Behavior

Tests succeed

Actual Behavior

Two tests fail:

array with required #249
replace example with x-example for response

Reproducible Demo

Follow steps to reproduce.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions