-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Path level $ref is not resolved #19
Comments
The ref being in there as-is is because it cannot be resolved. If you look at the |
Yes you need to spin up a server to serve the json file. It's not resolving even when the url is reachable |
I'll look into it. I also found: whitlockjc/json-refs#30 while working on this. |
Here is the test I'm using going forward: ---
swagger: '2.0'
info:
version: 0.0.0
title: Simple API
paths:
/:
$ref: 'http://petstore.swagger.io/v2/swagger.json#/paths/~1pet' |
I see this all over the editor.swagger.io console:
Not sure if that's important or not. |
In development version that error is not being thrown and instead shown to user. It's not finding the petstore security definitions in root swagger. Which makes sense. I'm still able to reproduce the original error. I just checked, the XHR to |
That error was the cause of the problem. This is an error in sway where we assume I'm not seeing a case where remote references do not work but once we fix this runtime issue, it should be easy to find since all unresolvable references (for whatever reason) are flagged as errors and we can see why. |
I'm not saying that this issue is fixed. I'm saying that when I fix sway not to bomb with the error above, remote references appear to work. |
sway@v0.2.2 is out. Try this and you should get the proper errors instead of a runtime failure. Come back to me with the unresolvable error information. (Disregard the missing references within the remote document as that is handled in json-refs/issues/30) |
For resolution I'm using this proxy project so I can use web workers. It's a bit more work to update sway but I'll do it today |
json-refs/issues/30 has been fixed and sway@master is updated to use it. Once we know if this issue is still valid and if so, what the real problem is, we can fix it and get a new release out. |
json-refs/issues/30 has been re-opened but should be unrelated to this. |
Fixed. json-refs now has tests using the exact same document in the example above and it is working properly. I will update sway, again, and you'll need to let me know how this impacts things. |
sway@v0.2.3 has been released with a patched json-refs to better handle references to remote documents with local references. (json-refs has tests for remote references with and without fragments) |
With the last build of sway, I am no longer able to reproduce any of the issues encountered today. |
I'm marking this as closed since we've fixed the known issues that were reproducible but are no longer reproducible. Things appear to be working as expected in the latest release but feel free to re-open if you have more details. |
Ok, I'll update you when I had a chance to try the new release. |
From swagger-api/swagger-editor#611
A simpler YAML to reproduce:
Inside
root.json
:After calling
SwaggerApi#create
theapi.definition
value is:The text was updated successfully, but these errors were encountered: