From 1489aecd511e4bf7b415f9f70a9b46747d9c68bd Mon Sep 17 00:00:00 2001 From: M Pacer Date: Mon, 10 Jun 2019 20:45:03 -0700 Subject: [PATCH] Improve documentation for bookstore's BookstoreVersionHandler methods. --- bookstore/handlers.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bookstore/handlers.py b/bookstore/handlers.py index 8f3af4f..6e763a6 100644 --- a/bookstore/handlers.py +++ b/bookstore/handlers.py @@ -20,21 +20,34 @@ class BookstoreVersionHandler(APIHandler): """Handler responsible for Bookstore version information Used to lay foundations for the bookstore package. Though, frontends can use this endpoint for feature detection. + + Methods + ------- + get(self) + Provides version info and feature availability based on serverside settings. + build_response_dict(self) + Helper to populate response. """ @web.authenticated def get(self): + """GET /api/bookstore/ + + Returns version info and validation info for various bookstore features. + """ self.finish(json.dumps(self.build_response_dict())) def build_response_dict(self): + """Helper for building the version handler's response before serialization.""" return { - "bookstore": True, + "bookstore": True, # TODO: Should we remove this; isn't it equivalent to the endpoint responding? "version": self.settings['bookstore']["version"], "validation": self.settings['bookstore']["validation"], } def build_settings_dict(validation): + """Helper for building the settings info that will be assigned to the web_app.""" return {"version": version, "validation": validation}