Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds swagger API documentation #180

Merged
merged 13 commits into from
Apr 26, 2018
Merged

Adds swagger API documentation #180

merged 13 commits into from
Apr 26, 2018

Conversation

jaredbriskman
Copy link
Contributor

Resolves #133 , and provides the groundwork for #142.

The documentation still doesn't have as much content as would be nice, but it's quite serviceable, and much more useful than the current state.

Instructions for how to add more documentation to swagger will be added to the abe developer cookbook, which should roll over to the wiki in the future.

Could easily change the documentation url from /swagger/ or the API version from 0.1 if there are better alternatives.

#175 will make this more discoverable as well.

@@ -24,6 +24,19 @@
from abe.helper_functions.sub_event_helpers import create_sub_event, update_sub_event, sub_event_to_full, access_sub_event, find_recurrence_end
from abe.helper_functions.query_helpers import get_to_event_search, event_query

api = Namespace('events', description='Events related operations')

event_model = api.model('Events_Model', {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment here and to Events, that when one is updated the other should be too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When you say "to Events", are you suggesting the document model? Or the class just below this?

Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand correctly, this statement needs to be manually (as we discussed) kept in sync with what I now see is event_documents.Event, so I was proposing a comment here and at the definition of event_documents.Event.

README.md Outdated
| GET | retrieve label with name "clubs" |
| PUT | update label with name "clubs" |
| DELETE | delete label with name "clubs" |
Interactive API documentation can be found at`/swagger/`, e.g. for local develepment: <http://127.0.0.1:3000/swagger/>.
Copy link
Contributor

Choose a reason for hiding this comment

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

"develepment" → "development"

@@ -22,12 +22,20 @@
from abe.helper_functions.query_helpers import get_to_event_search, event_query
from abe.helper_functions.ics_helpers import mongo_to_ics, extract_ics

api = Namespace('ics', description='ICS feeds')

ics_model = api.model("ICS_Model", {
Copy link
Contributor

Choose a reason for hiding this comment

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

See comment re Events_Model.

@@ -21,6 +21,18 @@
from abe.helper_functions.converting_helpers import mongo_to_dict, request_to_dict
from abe.helper_functions.query_helpers import multi_search

api = Namespace('labels', description='Label related operations')

label_model = api.model("Label_Model", {
Copy link
Contributor

Choose a reason for hiding this comment

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

See comment re Events_Model.

@@ -41,7 +41,13 @@
if os.environ.get('HSTS_ENABLED'):
SSLify(app, age=10, skips=['.well-known/acme-challenge/'])

api = Api(app)

@app.route('/') # For the splash to work, needs to be declared before API
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 recording motivation for placement

Copy link
Contributor

@osteele osteele left a comment

Choose a reason for hiding this comment

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

Solid! Requested a couple of minor changes.

@@ -24,6 +24,20 @@
from abe.helper_functions.sub_event_helpers import create_sub_event, update_sub_event, sub_event_to_full, access_sub_event, find_recurrence_end
from abe.helper_functions.query_helpers import get_to_event_search, event_query

api = Namespace('events', description='Events related operations')

#This should be kept in sync with the document model, which drives the format
Copy link
Contributor

Choose a reason for hiding this comment

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

This introduces a flake8 error, but I think it's time to get this PR in anyway; I'll address it in the next change.

@osteele osteele merged commit c7ac248 into dev Apr 26, 2018
@jaredbriskman jaredbriskman deleted the jwb-swagger branch April 26, 2018 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants