-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Remote references in components/schemas fail to resolve #351
Comments
This is a bug for sure. I will look into it ASAP. There is an overhaul of the indexing system in I will keep you posted. |
A resolution for this is coming with #357, running this spec through vacuum with a new |
Can you try this spec, with the latest version of vacuum, and use the |
I'm getting some inconsistent JSON error messages interspersed in the output. Testing against this which should have no errors:
I get the output
Between 0 and 2 of those random JSON lines. Also, sometimes it reports the error
|
Yeah, there is still work to be done here, the code is designed to need a 'base' to resolve from when using remote references, so this use-case where it's trying to figure out where the next set of references are coming from is still unstable. This will be one of my next upgrades to fix this use-case. |
I feel the fix will be small and simple and it will just click into place - but yeah still a little wobbly. Thank you for bearing with me. |
Cool, thank you for working on this!
…On Mon, 6 Nov 2023, 09:06 quobix, ***@***.***> wrote:
I feel the fix will be small and simple and it will just click into place
- but yeah still a little wobbly. Thank you for bearing with me.
—
Reply to this email directly, view it on GitHub
<#351 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJHEGV23YZB6QBESQCIJNLYDDVHLAVCNFSM6AAAAAA54TF2UCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJUHA4TSNJSG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Can you try again with |
0.4.4:
0.4.5:
both have the schema warning that ideally they shouldn't:
Also 0.4.4 has this warning, but 0.4.5 doesn't:
|
Are you able to share the exact command you're using? I can't re-create it using 0.4.5, are you still using the same specs above? |
Also, did you see this? https://quobix.com/vacuum/faq/#q-can-vacuum-just-look-up-remotefile-based-references-by-its-self If you just want vacuum to figure out where to look for remote files, or local files then just use the |
The only change to the command I was running was dropping
I'm testing against the file in this comment, though I get the same error with the file in the original post. |
100% reproducible, I've been going back and forth between 0.4.4 and 0.4.5. I'm on x86_64 linux in case it's a platform difference? |
Thank you, so let's break this down a little. This spec uses a single remote ref {
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "demo thing",
"description": "demo thing"
},
"servers": [ { "url": "whatever" } ],
"paths": {
"/b": {
"get": {
"operationId": "test",
"responses": {
"200": {
"description": "uses a thing in components/schemas",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SomeThing"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"SomeThing": {
"$ref": "https://raw.githubusercontent.com/pb33f/libopenapi/main/test_specs/burgershop.openapi.yaml#/components/requestBodies/BurgerRequest"
}
}
}
} Currently in vacuum v0.4.5, there are two ways to make use of this, the first is to use the new Option 1: Use the
|
That was the issue, not sure why I started doing --base, but without it everything works fine. |
I have a openapi spec that works fine on https://editor.swagger.io/ that throws errors with vacuum.
Remote references in
paths/.../schema
seem fine, but not incomponents/references/whatever
are not.I can't figure out how to modify the libopenapi tests in ways that don't crash, so I dunno if the issue is with them or not.
The spec:
This results in the error:
If you switch the URLs it still only fails on the
SomeThing
ref.I'm running with
npx vacuum lint --base . -d $specFile
, and I havevacuum
version 0.3.13The text was updated successfully, but these errors were encountered: