Skip to content

Passing "resolveInternal" option causes "RangeError" when resolving a spec #420

Open
@mihirkothari25

Description

Detailed description

This might be a bug with oas-resolver but the front-door we are using to resolve the OpenApi specs is speccy.
Resolving refs works fine with the following options

const SPECCY_OPTIONS = {
  resolve: true,
  jsonSchema: true,
}

The above options cause the first external ref to be resolved, but subsequent external refs to that same file get converted to internal refs.

We have a use case where we need all the refs to be resolved and not have any internal refs, so I used the following options

const SPECCY_OPTIONS = {
  resolve: true,
  jsonSchema: true,
  resolveInternal: true,
}

This causes the following error -

RangeError: Maximum call stack size exceeded
at String.replace (<anonymous>)
at jpescape (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/jptr.js:9:14)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:34:60)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
  • Node Version: 12.18.0
  • Operating system and version (e.g. Ubuntu 16.04, Windows 7): Mac 10.15.5
  • Speccy Version: 0.11.0

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