diff --git a/bigchaindb/common/schema/__init__.py b/bigchaindb/common/schema/__init__.py index b2e8129a..f7f0aa80 100644 --- a/bigchaindb/common/schema/__init__.py +++ b/bigchaindb/common/schema/__init__.py @@ -22,9 +22,14 @@ def _load_schema(name): return path, (schema, fast_schema) -TX_SCHEMA_PATH, TX_SCHEMA_COMMON = _load_schema('transaction') -_, TX_SCHEMA_CREATE = _load_schema('transaction_create') -_, TX_SCHEMA_TRANSFER = _load_schema('transaction_transfer') +TX_SCHEMA_VERSION = 'v1.0' + +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') diff --git a/bigchaindb/common/schema/transaction_create.yaml b/bigchaindb/common/schema/transaction_create_v1.0.yaml similarity index 100% rename from bigchaindb/common/schema/transaction_create.yaml rename to bigchaindb/common/schema/transaction_create_v1.0.yaml diff --git a/bigchaindb/common/schema/transaction_transfer.yaml b/bigchaindb/common/schema/transaction_transfer_v1.0.yaml similarity index 100% rename from bigchaindb/common/schema/transaction_transfer.yaml rename to bigchaindb/common/schema/transaction_transfer_v1.0.yaml diff --git a/bigchaindb/common/schema/transaction.yaml b/bigchaindb/common/schema/transaction_v1.0.yaml similarity index 98% rename from bigchaindb/common/schema/transaction.yaml rename to bigchaindb/common/schema/transaction_v1.0.yaml index 33f6a1f8..2d5a4964 100644 --- a/bigchaindb/common/schema/transaction.yaml +++ b/bigchaindb/common/schema/transaction_v1.0.yaml @@ -1,6 +1,5 @@ --- "$schema": "http://json-schema.org/draft-04/schema#" -id: "http://www.bigchaindb.com/schema/transaction.json" type: object additionalProperties: false title: Transaction Schema diff --git a/docs/server/source/appendices/tx-yaml-files.rst b/docs/server/source/appendices/tx-yaml-files.rst index f9a51685..64ac751c 100644 --- a/docs/server/source/appendices/tx-yaml-files.rst +++ b/docs/server/source/appendices/tx-yaml-files.rst @@ -2,11 +2,8 @@ The Transaction Schema Files ============================ BigchainDB checks all :ref:`transactions ` -(JSON documents) against a formal schema -defined in some JSON Schema files named -transaction.yaml, -transaction_create.yaml and -transaction_transfer.yaml. +against a formal schema +defined in some JSON Schema files. The contents of those files are copied below. To understand those contents (i.e. JSON Schema), check out @@ -16,22 +13,22 @@ by Michael Droettboom or `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 -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 -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 diff --git a/docs/server/source/data-models/transaction-model.rst b/docs/server/source/data-models/transaction-model.rst index 631399e2..2490a247 100644 --- a/docs/server/source/data-models/transaction-model.rst +++ b/docs/server/source/data-models/transaction-model.rst @@ -68,7 +68,6 @@ The Transaction Schema ---------------------- BigchainDB checks all transactions (JSON documents) -against a formal schema defined in :ref:`some JSON Schema files named -transaction.yaml, -transaction_create.yaml and -transaction_transfer.yaml `. +against a formal schema defined in :ref:`some JSON Schema files +(copied verbatim into the Appendices) +`.