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

Could not resolve reference: Failed to fetch #33

Open
oravecz opened this issue May 31, 2020 · 1 comment
Open

Could not resolve reference: Failed to fetch #33

oravecz opened this issue May 31, 2020 · 1 comment

Comments

@oravecz
Copy link

oravecz commented May 31, 2020

I originally thought this might be related to #30, however I now do not think it is.

I'm using Fastify v2.14.1, and I instantiate my own AJV and configure it using .addSchema(...). I then use the $id references from my manually loaded schemas when creating my route schemas. This works fine in Fastify, and I can tell the schemas are being validated at runtime.

However, when using the plugin UI, and navigating into a particular route, I get the following error, when the schema reference is attempted to be resolved.

Resolver error at paths./events.post.requestBody.content.application/json.schema.properties.rulesets.items.$ref
Could not resolve reference: Failed to fetch

The $ref I am using is a full URL with hostname, but I would expect the plugin to lookup the reference using AJV where it is registered, instead of attempting to fetch. Perhaps this is the wrong expectation?

@SkeLLLa
Copy link
Owner

SkeLLLa commented May 31, 2020

References are not well supported in 2.x.x, they will be supported in v3. However refs containing full will not likely will be supported, unless you manually create routes where swagger ui could access them via url.

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