question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Endless loop caused by json-schema-ref-parser

See original GitHub issue

Hello!

For some strange reason I yet not know, the “bundle” method of the class “$RefParser” seems to cause an endless loop on line 16: https://github.com/cdimascio/express-openapi-validator/blob/b8e34304ab5c2821a51c986e43b4b6ae4db51d05/src/framework/json.ref.schema.ts#L16

As I am the first one with this issue, maybe it is caused by my setup.

Those are my dependencies:

{
    "@typegoose/typegoose": "^6.1.5",
    "cors": "^2.8.5",
    "express": "^4.17.1",
    "express-openapi-validator": "^2.17.2",
    "express-session": "^1.17.0",
    "mongoose": "^5.7.12",
    "openid-client": "^3.8.3",
    "react": "^16.11.0",
    "react-dom": "^16.11.0",
    "swagger-ui-express": "^4.1.2",
    "webpack-pwa-manifest": "^4.0.0",
    "workbox-webpack-plugin": "^3.6.3",
    "yamljs": "^0.3.0"
  }

I also tried using different OpenAPI specs (also the one in the tests directory of this repo), with the same result.

Maybe it’s a dependecy conflict somehow?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
scriptifycommented, Nov 27, 2019

I’ll create a minimal example today after work. Thanks in the mean time!

0reactions
cdimasciocommented, Nov 29, 2019

Yeah, agreed, assuming a top level await its nice; almost no difference in the usage feel. The order of middleware matters, thus the validator needs to be set up prior your routes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Switch to APIDevTools/json-schema-ref-parser #1054 - GitHub
yaml it will run into an infinite loop and eat up your memory. Not sure if this is a known issue but it...
Read more >
json-schema-ref-parser - Bountysource
Parse, Resolve, and Dereference JSON Schema $ref pointers in Node and browsers ... API causes the dereference() method to spin forever in an...
Read more >
Infinite Recursion with Jackson JSON and Hibernate JPA issue
If you try to send to the view the class B or A with @ResponseBody it may cause an infinite loop. You can...
Read more >
Understanding JSON Schema
JSON Schema is a powerful tool for validating the structure of JSON ... to another $ref could cause an infinite loop in the...
Read more >
JSON Schema $Ref Parser - API Dev Tools
JSON Schema $Ref Parser is a full JSON Reference and JSON Pointer implementation that crawls even the most complex JSON Schemas and gives...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found