[WIP] API Explorer template front-end
Review Request #7905 — Created Jan. 24, 2016 and discarded
An API Explorer allows developers to make requests to the Web API from their browsers without having to download XML or JSON files. The API Explorer will display the response as syntax highlighted JSON in order to be understandable and facilitate development and understanding of the Web API.
In the future, users will be able to make POST, PUT and DELETE requests from a provided form and view documentation related to the resource.
This patch focuses on displaying the Web API response as syntax highlighted JSON, creating a form for POST, PUT and DELETE requests and displaying the appropriate documentation for the resource.
Tested /api/users/<user_name> and /api/users/ which returned the correct information in the proper format, which displayed correctly in a web browser.
Description | From | Last Updated |
---|---|---|
Use 1 space for indentation. |
brennie | |
We do block tags aligned to the left. We show nesting with additional spaces inside the template tag itself. {% … |
brennie | |
One space for indentation. |
brennie | |
See other comment about blocktags. Likewise for the rest of them here. |
brennie | |
We don't want to include CSS like this. We'll want to make use of static bundles. Have a look at … |
brennie | |
Blank line contains whitespace. |
brennie | |
Blank line contains whitespace. |
brennie | |
This file needs to be reformatted. |
brennie | |
Col: 9 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
Col: 9 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot |
- Change Summary:
-
-Added support for arrays to be displayed properly
-Added template tag that helps determine type of value
-Added basic styling and light syntax highlighting
-Added basic support for opening and closing braces - Description:
-
~ -Added initial template that displays the api request payload, unformatted.
~ An API Explorer allows developers to make requests to the Web API from their browsers without having to download XML or JSON files. The API Explorer will display the response as syntax highlighted JSON in order to be understandable and facilitate development and understanding of the Web API.
+ + In the future, users will be able to make POST, PUT and DELETE requests from a provided form and view documentation related to the resource.
+ + This patch focuses on displaying the Web API response as syntax highlighted JSON, creating a form for POST, PUT and DELETE requests and displaying the appropriate documentation for the resource.
- Testing Done:
-
+ Tested /api/users/<user_name> and /api/users/ which returned the correct information in the proper format, which displayed correctly in a web browser.
-
Tool: Pyflakes Ignored Files: reviewboard/templates/webapi/nested.html reviewboard/templates/webapi/apiexplorer.html Tool: PEP8 Style Checker Ignored Files: reviewboard/templates/webapi/nested.html reviewboard/templates/webapi/apiexplorer.html
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/templates/webapi/nested.html reviewboard/templates/webapi/apiexplorer.html Tool: Pyflakes Ignored Files: reviewboard/templates/webapi/nested.html reviewboard/templates/webapi/apiexplorer.html
-
-
We don't want to include CSS like this. We'll want to make use of static bundles. Have a look at
staticbundles.py
to see what files end up where.You may want to add a new static bundle for the API explorer, but I could be wrong. You'll also want to look at https://github.com/reviewboard/reviewboard/blob/master/reviewboard/templates/base.html#L24 to see how we include CSS.
The same goes for JS that will eventually go here.
-
-
-
-
Tool: Pyflakes Ignored Files: reviewboard/templates/webapi/nested.html reviewboard/templates/webapi/apiexplorer.html Tool: PEP8 Style Checker Ignored Files: reviewboard/templates/webapi/nested.html reviewboard/templates/webapi/apiexplorer.html
- Change Summary:
-
-Added ability to handle fields from a resource
-Added support for primitive types for fields of the resource
-
Tool: Pyflakes Ignored Files: reviewboard/templates/webapi/nested.html reviewboard/templates/webapi/apiexplorer.html Tool: PEP8 Style Checker Ignored Files: reviewboard/templates/webapi/nested.html reviewboard/templates/webapi/apiexplorer.html
- Change Summary:
-
-Added ability to handle required and optional fields
-Added support for GET and POST fields
-Added modularization to generation of fields on the template
-Removed unused file
-
Tool: Pyflakes Ignored Files: reviewboard/templates/webapi/fields.html reviewboard/templates/webapi/apiexplorer.html Tool: PEP8 Style Checker Ignored Files: reviewboard/templates/webapi/fields.html reviewboard/templates/webapi/apiexplorer.html
- Change Summary:
-
-Added support for Javascript on API Explorer front-end template -Added ability for form to disable inputs that are empty -Added ability to make GET and POST requests to a resource -Updated name of page used by API Explorer front-end template to a more appropriate name
-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/webapi/utils/apiCaller.js reviewboard/templates/webapi/restform.html reviewboard/templates/webapi/apiexplorer.html Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/webapi/utils/apiCaller.js reviewboard/templates/webapi/restform.html reviewboard/templates/webapi/apiexplorer.html
-
- Change Summary:
-
-Added support for displaying only the payload of a GET request
-Updated ability for form to disable inputs that are empty to handle more types
-Added success message when a POST request was successful
-Updated success codes to ensure that successful POST requests are considered such
-Added styling to forms to make them presentable
-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/templates/webapi/payload-only.html reviewboard/static/rb/js/webapi/utils/apiCaller.js reviewboard/templates/webapi/restform.html reviewboard/static/rb/js/utils/apiUtils.js reviewboard/templates/webapi/apiexplorer.html Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/templates/webapi/payload-only.html reviewboard/static/rb/js/webapi/utils/apiCaller.js reviewboard/templates/webapi/restform.html reviewboard/static/rb/js/utils/apiUtils.js reviewboard/templates/webapi/apiexplorer.html
-
- Change Summary:
-
- Added support for latest RB version
- Added support for Collapsible HTML components
- Added support for content pipeline
-
Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/templates/webapi/payload-only.html reviewboard/static/rb/js/webapi/utils/apiCaller.js reviewboard/templates/webapi/restform.html reviewboard/templates/webapi/apiexplorer.html Tool: Pyflakes Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/templates/webapi/payload-only.html reviewboard/static/rb/js/webapi/utils/apiCaller.js reviewboard/templates/webapi/restform.html reviewboard/templates/webapi/apiexplorer.html
- Change Summary:
-
- Updated templates to handle different contexts efficiently
- Added collapsible HTML elements to the API Explorer
- Added support for file uploads on the API Explorer
- Updated how HTML elements are disabled when making requests on the API Explorer
- Fixed an issue making POST requests with the API Explorer front-end
-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/templates/webapi/payload-only.html reviewboard/static/rb/js/webapi/utils/apiCaller.js reviewboard/templates/webapi/restform.html reviewboard/templates/webapi/apiexplorer.html Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/templates/webapi/payload-only.html reviewboard/static/rb/js/webapi/utils/apiCaller.js reviewboard/templates/webapi/restform.html reviewboard/templates/webapi/apiexplorer.html