-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash with recursive definition in referenced OpenAPI file #132
Comments
I've also validated the files with Redocly's openapi-cli, which did catch some other stuff in my real API definition that swagger-cli did not, but was totally fine with the architecture represented in the above minimal case that causes such issues in Exegesis. |
I am very surprised this is breaking; I certainly have recursive defs similar to this in my OpenAPI def. I'm looking into this now. I am extremely suspicious of:
Note the "roperties" in that path. We do this thing in exegesis where, when we construct a validator, we extract the schema out of OpenAPI and turn it into a plain JSON schema, but we also transform that schema so there's a root object that looks like This line is obviously very suspicious here. -_- |
As I noted if everything is in a single file then it works fine, see note 2. It's only when the recursive component is in a secondary file that this happens, e.g. note 1. So it's likely your similar OpenAPI def is all in one big file. |
No, ours is in 139 files. :P But this problem looks to basically be a case where I'm assuming my json-ptr is going to be in URI fragment format, when it isn't. Should be a straightforward fix. |
🎉 This issue has been resolved in version 2.5.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The following is marked as valid by
swagger-cli validate openapi.yaml
using swagger-cli 3.0.1.Tested using
"exegesis-express": "^2.0.0",
which is bringing in"exegesis": { "version": "2.5.1",
on both Node.js 10 and 13 under Ubuntu 18.04.Of course my real spec files are much larger and more complex, I've pared them down drastically into a minimal set.
Expected
Assuming the declared service file exists, exports a the
fetch
method requested, etc. that he service should ready itself and launch.What happens
An exception is thrown with the following message:
Setting a a breakpoint for uncaught exceptions lands me in
ajs.js
line 350:Notes
with
there is likewise no error.
From doing some digging in AJS's repo and issue tracker it looks like they support recursive definitions just fine, but that they often find that people aren't doing things right when feeding the library. Dunno if that's the case here, but from what I've read this doesn't appear to be an AJS problem, which leads me back here.
The text was updated successfully, but these errors were encountered: