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

Invalid URL error is cryptic #86

Open
strets123 opened this issue Nov 14, 2019 · 1 comment
Open

Invalid URL error is cryptic #86

strets123 opened this issue Nov 14, 2019 · 1 comment

Comments

@strets123
Copy link

strets123 commented Nov 14, 2019

When I validate a spec containing a $ref pointing to a file then I get an error like

jsonschema.exceptions.RefResolutionError: unknown url type: '../shared.yaml'

At the jsonschema level this makes some sense but clearly there is something I can do about it as an opeanapi validator user. Therefore I argue we should catch and reraise a separate exception telling the user to pass in a filename in the format file://myfile.yaml

Where shouild such handling go? In this method?

https://github.com/p1c2u/openapi-spec-validator/blob/f13bd8c4e05f8c2ab1c54c6021897d8ad99f29f9/openapi_spec_validator/validators.py#L48

@p1c2u
Copy link
Collaborator

p1c2u commented Jan 13, 2020

I believe it should be handled by 3tf party libraries/projects that use openapi-spec-validator. We can't tell openapi validator user that he should use file:// because it depends on which handlers you use.

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