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

Resolving reference error happens with directories of different depths #402

Closed
stakme opened this issue Aug 13, 2021 · 0 comments · Fixed by #403
Closed

Resolving reference error happens with directories of different depths #402

stakme opened this issue Aug 13, 2021 · 0 comments · Fixed by #403

Comments

@stakme
Copy link
Contributor

stakme commented Aug 13, 2021

Hi. I found the recursive lookup will fail when there are files in directories of different depths.

reporduce: https://github.com/stakme/kin-openapi/commit/cefedea2d71ad4ce07f2739ecbaea4c4f113f9cd

> go test github.com/getkin/kin-openapi/openapi3
--- FAIL: TestLoaderReadFromURIFunc (0.00s)
    loader_read_from_uri_func_test.go:20: 
                Error Trace:    loader_read_from_uri_func_test.go:20
                Error:          Received unexpected error:
                                error resolving reference "../openapi.yml#/components/schemas/Bar": open testdata/recursiveRef/components/openapi.yml: no such file or directory
                Test:           TestLoaderReadFromURIFunc
--- FAIL: TestLoaderSupportsRecursiveReference (0.00s)
    loader_recursive_ref_test.go:13: 
                Error Trace:    loader_recursive_ref_test.go:13
                Error:          Received unexpected error:
                                error resolving reference "../openapi.yml#/components/schemas/Bar": open testdata/recursiveRef/components/openapi.yml: no such file or directory
                Test:           TestLoaderSupportsRecursiveReference
FAIL
FAIL    github.com/getkin/kin-openapi/openapi3  0.192s
FAIL

It seems that, each time it resolve the reference, it needs to update the documentPath.

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

Successfully merging a pull request may close this issue.

1 participant