-
Notifications
You must be signed in to change notification settings - Fork 35
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
I can't use $ref to pull in other yaml files #238
Comments
Hey @evhabs, thanks for raising this, did you resolve the issue? |
Sorry for the delay! I think your issue is quite different to #229, which is about what to do when the request path matches multiple paths in the OpenAPI document. Your issue is that you want to reference other files via If you'd like this enhancement (or bug fix, whatever you want to call it), a PR would be very welcome 😄 You could either expand that function to recognise file refs and look in those files, or ideally there'd be some npm package to manage that complexity for us. Here are some docs I found on how |
Oh I didn't see #216 i'll have to try this out when I get sometime later this week i'll try it out |
Which package are you using?
chai-openapi-response-validator
/jest-openapi
OpenAPI version
3
Describe the bug
In my response I try to use $ref to ask for a model and i consistantly get this error:
received did not satisfy it because: products[0] can't resolve reference ./models/Product.v1.yaml
I've tried moving it into the same folder and doing './Product.v1.yaml' but it still doesn't work.
Here is part of my reference file that is in question:
Is this type of notation supported? Or do I need to have items: point to something like
$ref: '#/definitions/ComponentType/Product'
To Reproduce
Steps to reproduce the behavior:
expect(res).toSatisfyApiSpec();
Expected behavior
I expected it to find the yaml file and do correct comparisons against my API doc
Are you going to resolve the issue?
If it something that needs to be added I don't mind taking a look
The text was updated successfully, but these errors were encountered: