-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
@@ -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', { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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/>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"develepment" → "development"
abe/resource_models/ics_resources.py
Outdated
@@ -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", { |
There was a problem hiding this comment.
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", { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 recording motivation for placement
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
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 from0.1
if there are better alternatives.#175 will make this more discoverable as well.