Closed ysangkok closed 2 years ago
You can validate a local file, it's just not well document, Use file://
urls, or pass the spec to https://github.com/Yelp/swagger_spec_validator/blob/v1.0.8/swagger_spec_validator/validator20.py#L27
it would still be very useful if i could pass a string instead of having to write it to disk first...
You can do this.
from swagger_spec_validator.util import get_validator
spec_json = get_swagger()
validator = get_validator(spec_json)
validator.validate_spec(spec_json)
where get_swagger
is a method for acquiring the string and JSON-parsing it
Closing since I stopped using this project.
or any local file for that matter? thanks in advance.