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

Cannot use refs in the same document #132

Open
jgresty opened this issue Jan 26, 2022 · 1 comment
Open

Cannot use refs in the same document #132

jgresty opened this issue Jan 26, 2022 · 1 comment
Assignees

Comments

@jgresty
Copy link
Member

jgresty commented Jan 26, 2022

Using a schema with a ref in it that points to the same document fails with the error

failed to load spec versions: failed to load resource at "the/schema/location": failed to localize refs: map key "components" not found

An example ref would be:
$ref: '#/components/schemas/Foobar'
a workaround is changing the ref to point to the current file, ie:
$ref: ./foo.yaml#/components/schemas/Foobar

@cmars
Copy link
Contributor

cmars commented Feb 4, 2022

I'm really surprised this didn't work! I'll add a test case and work with it. Very strange...

@cmars cmars self-assigned this Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants