-
Notifications
You must be signed in to change notification settings - Fork 352
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
[CLI] Ref Resolving is Failing #2578
Comments
I think I have experienced the same problem. Could you check if the workaround from stoplightio/json#146 fixes it for you? |
@Didel |
Hhm. Perhaps you could try to add @stoplight/json 3.21.0 as a direct dependency, that might work for now (but is less preferred than the override).
I have no clue, I'm just a user experiencing the issue just like you 🙂 |
@mnaumanali94 I think the problem can be reproduced with the provided yml in stoplightio/json#146
That is also the case for me. The first 2 endpoints work fine, the third one throws the error mentioned in that issue. When only swapping the order of the endpoints, again, the first 2 work, the third one does not work (while the exact same configuration worked before changing the order) |
@Didel We were trying to reproduce this using the spec in stoplightio/json#146 but struggling to get the same behavior. If you have a spec handy that we could use to reproduce this, that would be great otherwise we'll keep trying on our side. |
@mnaumanali94 Sure! I couldn't copy/paste what I was working with, but I managed to recreate a minimal example that has the same structure and shows the same problem, see https://gist.github.com/Didel/d489c4439d0d6ea48d1cba5955e21c24 I am running NodeJS version 20.17.0 (the current latest LTS-version). To reproduce the issue:
I hope this should provide enough information to reproduce the error! |
@ckoegel Another possible workaround would be to generate a dereferenced spec using
|
@mnaumanali94 Were you able to reproduce the issue with the above gist? |
It seems that this issue is resolved in the current version of Prism (5.12.0 and higher). The above gist also doesn't show the problem any more, so this issue can likely be closed. |
We use the prism CLI to unit test our SDKs, and over the last week, these unit tests have been failing due to response errors that seem to come from
$ref
s being incorrectly resolved in the OpenAPI spec. This was previously working and no code in the tests or the spec file have been made.Context
This bug has caused our unit test suites to fail for our SDKs across Ruby, Python, and Node.
Current Behavior
When running our test suite, one endpoint returns a 500 error due to an invalid reference token. Prior to today (8/2), there were 3 endpoints that had issues, all with similar reference issues, but as of this morning, it is now just the one. The current error is below.
[HTTP SERVER] get /accounts/***/calls/c-1234/recordings/r-1234 ✖ error Request terminated with error: Error: Invalid reference token: __bundled__
Here is a link to a run in Github where the tests succeeded 3 weeks ago and then failed on a re-run this morning.
Success: https://github.com/Bandwidth/python-sdk/actions/runs/9911218308/attempts/1
Fail: https://github.com/Bandwidth/python-sdk/actions/runs/9911218308/attempts/2
This run in Node from 2 days ago shows the previous 3 errors, all of which seem to be related.
https://github.com/Bandwidth/node-sdk/actions/runs/10187817666
Expected Behavior
These test should all pass and the $ref's should resolve properly.
Possible Workaround/Solution
I've attempted to downgrade to an old version of prism (5.8.1), but this has not helped. I'm unaware of a workaround for this.
Steps to Reproduce
Relevant GH Run Links:
https://github.com/Bandwidth/node-sdk/actions/runs/10186773988
https://github.com/Bandwidth/python-sdk/actions/runs/9911218308
yarn # or npm install
Environment
The text was updated successfully, but these errors were encountered: