Extracting YAML/JSON spec from docstrings
FedericoCeratto opened this issue · 0 comments
FedericoCeratto commented
Hello and thanks for developing swagger.
It would be very useful to be able to extract a YAML/JSON file from the docstrings. It would allow keeping the API specs close to the implementation code but also provide a spec file to API users. Is there a recommended way to do it?
As a temporary workaround I used:
s = Swagger(app, parse=True)
...
with app.app_context():
apispecs = s.get_apispecs()
Or fetching the apispec URL locally:
with app.test_client() as client:
j = client.get("/apispec_1.json").json