MCPcopy Index your code
hub / github.com/diffgram/diffgram / setup_swagger

Function setup_swagger

default/swagger_setup.py:5–28  ·  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 Default API'
10 }
11 swagger = Swagger(app, template = {
12 "swagger": "2.0",
13 "info": {
14 "title": "Diffgram Default 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 path = "docs/swagger_spec.json"
26 with open(path, "w") as write_file:
27 json.dump(data, write_file, indent = 4)
28 return path

Callers 1

main.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected