Skip to content

Commit

Permalink
add swagger header (#877)
Browse files Browse the repository at this point in the history
* add swagger header

* edit links in template
  • Loading branch information
n00rsy committed Oct 13, 2023
1 parent 0223276 commit dc4e90b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 1 addition & 5 deletions pybossa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ def create_app(run_as_server=True):

setup_logging(run_as_server)
app = Flask(__name__.split('.')[0])
app.config['SWAGGER'] = {
'title': 'GIGwork API',
}
swag = Swagger(app)
configure_app(app)
global talisman
talisman = Talisman(app, content_security_policy={
Expand Down Expand Up @@ -100,7 +96,7 @@ def create_app(run_as_server=True):
anonymizer.init_app(app)
setup_task_presenter_editor(app)
setup_schedulers(app)

Swagger(app, template=app.config.get('SWAGGER_TEMPLATE'))
return app

# construct rq_dashboard config
Expand Down
9 changes: 8 additions & 1 deletion pybossa/settings_local.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -526,4 +526,11 @@ USAGE_DASHBOARD_COMPONENTS = {
'Multiselect Input' : 'multi-select-input',
'Table' : 'table-element',
'Input Text Area' : 'input-text-area'
}
}

SWAGGER_TEMPLATE = {
'info': {
'title': 'Local GIGwork API',
'description': 'Explore and experiment with Gigwork\'s REST APIs.\nUseful Links:\n- [Pybossa Docs](https://docs.pybossa.com/)',
},
}
7 changes: 7 additions & 0 deletions settings_test.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,10 @@ COMPLETED_TASK_CLEANUP_DAYS = [
MAX_IMAGE_UPLOAD_SIZE_MB = 5

MAX_SAVED_ANSWERS = 1

SWAGGER_TEMPLATE = {
'info': {
'title': 'Local GIGwork API',
'description': 'Explore and experiment with Gigwork\'s REST APIs.\nUseful Links:\n- [Pybossa Docs](https://docs.pybossa.com/)',
},
}

0 comments on commit dc4e90b

Please sign in to comment.