Merge pull request #1878 from bigchaindb/issue/1873/version-the-tx-schema-files

Version the transaction schema files
This commit is contained in:
Troy McConaghy 2017-11-22 16:41:09 +01:00 committed by GitHub
commit dd24bd8fb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 22 deletions

View File

@ -22,9 +22,14 @@ def _load_schema(name):
return path, (schema, fast_schema) return path, (schema, fast_schema)
TX_SCHEMA_PATH, TX_SCHEMA_COMMON = _load_schema('transaction') TX_SCHEMA_VERSION = 'v1.0'
_, TX_SCHEMA_CREATE = _load_schema('transaction_create')
_, TX_SCHEMA_TRANSFER = _load_schema('transaction_transfer') TX_SCHEMA_PATH, TX_SCHEMA_COMMON = _load_schema('transaction_' +
TX_SCHEMA_VERSION)
_, TX_SCHEMA_CREATE = _load_schema('transaction_create_' +
TX_SCHEMA_VERSION)
_, TX_SCHEMA_TRANSFER = _load_schema('transaction_transfer_' +
TX_SCHEMA_VERSION)
VOTE_SCHEMA_PATH, VOTE_SCHEMA = _load_schema('vote') VOTE_SCHEMA_PATH, VOTE_SCHEMA = _load_schema('vote')

View File

@ -1,6 +1,5 @@
--- ---
"$schema": "http://json-schema.org/draft-04/schema#" "$schema": "http://json-schema.org/draft-04/schema#"
id: "http://www.bigchaindb.com/schema/transaction.json"
type: object type: object
additionalProperties: false additionalProperties: false
title: Transaction Schema title: Transaction Schema

View File

@ -2,11 +2,8 @@ The Transaction Schema Files
============================ ============================
BigchainDB checks all :ref:`transactions <The Transaction Model>` BigchainDB checks all :ref:`transactions <The Transaction Model>`
(JSON documents) against a formal schema against a formal schema
defined in some JSON Schema files named defined in some JSON Schema files.
transaction.yaml,
transaction_create.yaml and
transaction_transfer.yaml.
The contents of those files are copied below. The contents of those files are copied below.
To understand those contents To understand those contents
(i.e. JSON Schema), check out (i.e. JSON Schema), check out
@ -16,22 +13,22 @@ by Michael Droettboom or
`json-schema.org <http://json-schema.org/>`_. `json-schema.org <http://json-schema.org/>`_.
transaction.yaml transaction_v1.0.yaml
---------------- ---------------------
.. literalinclude:: ../../../../bigchaindb/common/schema/transaction.yaml .. literalinclude:: ../../../../bigchaindb/common/schema/transaction_v1.0.yaml
:language: yaml :language: yaml
transaction_create.yaml transaction_create_v1.0.yaml
----------------------- ----------------------------
.. literalinclude:: ../../../../bigchaindb/common/schema/transaction_create.yaml .. literalinclude:: ../../../../bigchaindb/common/schema/transaction_create_v1.0.yaml
:language: yaml :language: yaml
transaction_transfer.yaml transaction_transfer_v1.0.yaml
------------------------- ------------------------------
.. literalinclude:: ../../../../bigchaindb/common/schema/transaction_transfer.yaml .. literalinclude:: ../../../../bigchaindb/common/schema/transaction_transfer_v1.0.yaml
:language: yaml :language: yaml

View File

@ -68,7 +68,6 @@ The Transaction Schema
---------------------- ----------------------
BigchainDB checks all transactions (JSON documents) BigchainDB checks all transactions (JSON documents)
against a formal schema defined in :ref:`some JSON Schema files named against a formal schema defined in :ref:`some JSON Schema files
transaction.yaml, (copied verbatim into the Appendices)
transaction_create.yaml and <The Transaction Schema Files>`.
transaction_transfer.yaml <The Transaction Schema Files>`.