Skip to content

Commit

Permalink
List the "blocks" endpoint in response to HTTP info requests (#2545)
Browse files Browse the repository at this point in the history
* Problem: HTTP info endpoints don't include "blocks"

Solution: Add "blocks" to the response to the HTTP info endpoints

* Removed "blocks" endpoints from "Advanced Usage"
because they are really not that advanced
  • Loading branch information
ttmc authored and vrde committed Sep 17, 2018
1 parent e689363 commit 8e5f770
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions bigchaindb/web/views/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def get_api_v1_info(api_prefix):
return {
'docs': ''.join(docs_url),
'transactions': '{}transactions/'.format(api_prefix),
'blocks': '{}blocks/'.format(api_prefix),
'assets': '{}assets/'.format(api_prefix),
'outputs': '{}outputs/'.format(api_prefix),
'streams': websocket_root,
Expand Down
8 changes: 1 addition & 7 deletions docs/server/source/http-client-server-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -616,14 +616,8 @@ Validators
:statuscode 200: The query was executed successfully and validators set was returned.


Advanced Usage
--------------------------------

The following endpoints are more advanced
and meant for debugging and transparency purposes.

Blocks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------

.. http:get:: /api/v1/blocks/{block_height}
Expand Down
2 changes: 2 additions & 0 deletions tests/web/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def test_api_root_endpoint(client, wsserver_base_url):
'v1': {
'docs': ''.join(docs_url),
'transactions': '/api/v1/transactions/',
'blocks': '/api/v1/blocks/',
'assets': '/api/v1/assets/',
'outputs': '/api/v1/outputs/',
'streams': '{}/api/v1/streams/valid_transactions'.format(
Expand All @@ -38,6 +39,7 @@ def test_api_v1_endpoint(client, wsserver_base_url):
api_v1_info = {
'docs': ''.join(docs_url),
'transactions': '/transactions/',
'blocks': '/blocks/',
'assets': '/assets/',
'outputs': '/outputs/',
'streams': '{}/api/v1/streams/valid_transactions'.format(
Expand Down

0 comments on commit 8e5f770

Please sign in to comment.