openapi-spec-validator
openapi-spec-validator copied to clipboard
Invalid URL error is cryptic
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