Skip to content
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

Issues resolving OpenAPI references #488

Open
LukeHagar opened this issue Apr 19, 2024 · 12 comments
Open

Issues resolving OpenAPI references #488

LukeHagar opened this issue Apr 19, 2024 · 12 comments
Labels
documentation Improvements or additions to documentation

Comments

@LukeHagar
Copy link

Here is the error in VSCode:
image

Here is the path in the file referenced:
image

Additionally the web docs path for the vacuum linting error sends me here:
https://quobix.com/vacuum/rules/schemas/resolving-references/

But this link goes right to a 404

@daveshanley
Copy link
Owner

daveshanley commented Apr 19, 2024

This failure is happening because of the x- prefix, it looks like an extension, so it's not indexed, which means it cannot be looked up.

And the 404, yeah I know about that one - thanks for the nudge. I will address it.

@daveshanley
Copy link
Owner

If you look here: https://spec.openapis.org/oas/v3.1.0#header-object

You can see that Header objects can be extended with extensions, which means anything with x- as a prefix is considered an extension and is excluded .

@daveshanley daveshanley added the documentation Improvements or additions to documentation label Apr 19, 2024
@LukeHagar
Copy link
Author

Should that still be parsed that way when its at the name level of the object and not a property?

@LukeHagar
Copy link
Author

LukeHagar commented Apr 19, 2024

Also if its exclusively the x- that is the problem, how about these references?
image

image

@LukeHagar
Copy link
Author

image

@daveshanley
Copy link
Owner

Have you configured vacuum when using the VSCode plugin? And set a base path?

@LukeHagar
Copy link
Author

LukeHagar commented Apr 19, 2024 via email

@daveshanley
Copy link
Owner

Well, not out of the gate, it's why there is a --base / -p flag to tell vacuum where to look as people tend to scatter things all over the place.

Check out the configuration options and set a base path. Let me know how that works, and then perhaps we can look at tuning the VScode plugin to try and set it automatically.

@LukeHagar
Copy link
Author

LukeHagar commented Apr 23, 2024

Just a note that adding a vacuum.conf.yaml with a base of "." does not resolve this issue.

@daveshanley
Copy link
Owner

does it work when you use vaccum outside of VSCode just as a CLI tool?

@LukeHagar
Copy link
Author

It seems to be, or at least its not providing the same errors.

It's now saying the below for most of these $refs

 a `$ref` cannot be placed next to any other properties 

But this seems to go against the documentation for $refs being able to include a description.
https://www.speakeasyapi.dev/openapi/references

@LukeHagar
Copy link
Author

I recognize these latest errors are also mentioned here: #484

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants