Merge pull request #1890 from bigchaindb/advertise-metadata

Add metadata endpoint to info view
This commit is contained in:
Ahmed Muawia Khan
2017-11-23 11:16:50 +01:00
committed by GitHub
3 changed files with 6 additions and 2 deletions

View File

@@ -50,5 +50,6 @@ def get_api_v1_info(api_prefix):
'statuses': '{}statuses/'.format(api_prefix),
'assets': '{}assets/'.format(api_prefix),
'outputs': '{}outputs/'.format(api_prefix),
'streams': websocket_root
'streams': websocket_root,
'metadata': '{}metadata/'.format(api_prefix),
}

View File

@@ -45,9 +45,10 @@ Here's some explanation of the contents:
- **metadata**: User-provided transaction metadata.
It can be any valid JSON document, or ``null``.
**NOTE:** When using MongoDB for storage, certain restriction apply
to all (including nested) keys of the ``"data"`` JSON document:
to all (including nested) keys of the JSON document:
1) keys (i.e. key names, not values) must **not** begin with the ``$`` character, and
2) keys must not contain ``.`` or the null character (Unicode code point 0000).
3) The key `"language"` (at any level in the hierarchy) is a special key and used for specifying text search language. Its value must be one of the allowed values; see the valid `Text Search Languages <https://docs.mongodb.com/manual/reference/text-search-languages/>`_ in the MongoDB Docs. In BigchainDB, only the languages supported by *MongoDB community edition* are allowed.
**How the transaction ID is computed.**
1) Build a Python dictionary containing ``version``, ``inputs``, ``outputs``, ``operation``, ``asset``, ``metadata`` and their values,

View File

@@ -18,6 +18,7 @@ def test_api_root_endpoint(client, wsserver_base_url):
'outputs': '/api/v1/outputs/',
'streams': '{}/api/v1/streams/valid_transactions'.format(
wsserver_base_url),
"metadata": "/api/v1/metadata/"
}
},
'docs': 'https://docs.bigchaindb.com/projects/server/en/vtsttst/',
@@ -41,6 +42,7 @@ def test_api_v1_endpoint(client, wsserver_base_url):
'outputs': '/outputs/',
'streams': '{}/api/v1/streams/valid_transactions'.format(
wsserver_base_url),
"metadata": "/metadata/"
}
res = client.get('/api/v1')
assert res.json == api_v1_info