Skip to content

!_.isUndefied(null) throws TypeError: Cannot read property '$ref' of undefined #39

Description

@sanjulr
  1. What version of the module is the issue happening on? Does the issue happen on latest version?
    Issue is present in the latest version.

  2. What platform and Node.js version? (For example Node.js 0.12 on Mac OS X)
    12.13.0 and Mac OS X

  3. Sample source code or steps to reproduce
    openapi-validator-middleware uses this library and when initiating that middleware with a json spec, it throws TypeError: Cannot read property '$ref' of undefined.

The fix is pretty simple. In this library's checkLocalCircular and derefSchema function, change !_.isUndefined(null) to !_.isUndefined(node)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions