Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

TIG-1956: Add openapi support #2

Merged
merged 7 commits into from
Oct 1, 2019
Merged

TIG-1956: Add openapi support #2

merged 7 commits into from
Oct 1, 2019

Conversation

zamj
Copy link
Contributor

@zamj zamj commented Oct 1, 2019

No description provided.

@zamj zamj requested review from dbradf and lydiastepanek October 1, 2019 14:26
@zamj zamj added the ready for review This PR is ready to be reviewed. label Oct 1, 2019
@@ -1,4 +1,4 @@
black==19.3b0
gunicorn==19.9.0
pytest-flake8==1.0.4
pytest==4.2.1
pytest==5.2.0
Copy link
Contributor Author

@zamj zamj Oct 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was facing an issue where pytest would fail to run. Looks like it's linked to this issue: pytest-dev/pytest#3280

The new version is the latest released.

Logs are below from evergreen task

[2019/10/01 12:17:22.423]   File "/data/mci/dd436d719c53531abd0929e7d98004f2/src/venv/bin/pytest", line 10, in <module>
[2019/10/01 12:17:22.423]     sys.exit(main())
[2019/10/01 12:17:22.423]   File "/data/mci/dd436d719c53531abd0929e7d98004f2/src/venv/lib/python3.7/site-packages/_pytest/config/__init__.py", line 61, in main
[2019/10/01 12:17:22.423]     config = _prepareconfig(args, plugins)
[2019/10/01 12:17:22.423]   File "/data/mci/dd436d719c53531abd0929e7d98004f2/src/venv/lib/python3.7/site-packages/_pytest/config/__init__.py", line 182, in _prepareconfig
[2019/10/01 12:17:22.423]     config = get_config()
[2019/10/01 12:17:22.423]   File "/data/mci/dd436d719c53531abd0929e7d98004f2/src/venv/lib/python3.7/site-packages/_pytest/config/__init__.py", line 156, in get_config
[2019/10/01 12:17:22.423]     pluginmanager.import_plugin(spec)
[2019/10/01 12:17:22.423]   File "/data/mci/dd436d719c53531abd0929e7d98004f2/src/venv/lib/python3.7/site-packages/_pytest/config/__init__.py", line 533, in import_plugin
[2019/10/01 12:17:22.423]     __import__(importspec)
[2019/10/01 12:17:22.423]   File "/data/mci/dd436d719c53531abd0929e7d98004f2/src/venv/lib/python3.7/site-packages/_pytest/tmpdir.py", line 25, in <module>
[2019/10/01 12:17:22.423]     class TempPathFactory(object):
[2019/10/01 12:17:22.423]   File "/data/mci/dd436d719c53531abd0929e7d98004f2/src/venv/lib/python3.7/site-packages/_pytest/tmpdir.py", line 35, in TempPathFactory
[2019/10/01 12:17:22.423]     lambda p: Path(os.path.abspath(six.text_type(p)))
[2019/10/01 12:17:22.423] TypeError: attrib() got an unexpected keyword argument 'convert'```

from flask_restplus import Api, Resource, fields


def add_health_endpoints(api: Api):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a docstring to this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

health_model = ns.model("HealthCheckResponse", {"online": fields.Boolean})

@ns.route("")
class Health(Resource):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a docstring to this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@zamj zamj merged commit 5cf0ffe into mongodb:master Oct 1, 2019
@zamj zamj deleted the add_swagger branch October 1, 2019 18:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ready for review This PR is ready to be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants