MCPcopy Create free account
hub / github.com/diffgram/diffgram / setup_swagger

Function setup_swagger

walrus/swagger_setup.py:5–26  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

3
4
5def setup_swagger(app):
6 with app.app_context():
7 from flasgger import Swagger
8 app.config['SWAGGER'] = {
9 'title': 'Diffgram Walrus API'
10 }
11 swagger = Swagger(app, template = {
12 "swagger": "2.0",
13 "info": {
14 "title": "Diffgram Walrus API",
15 "version": "1.0",
16 },
17 "consumes": [
18 "application/json",
19 ],
20 "produces": [
21 "application/json",
22 ],
23 })
24 data = swagger.get_apispecs()
25 with open("docs/swagger_spec.json", "w") as write_file:
26 json.dump(data, write_file, indent = 4)

Callers 1

main.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected