From f23a2c4042213dbef191e3e40ffd88d0521ef2c6 Mon Sep 17 00:00:00 2001 From: Troy McConaghy Date: Thu, 23 Nov 2017 14:45:23 +0100 Subject: [PATCH 1/2] Removed appendix page w/ tx JSON Schema files & updated transaction-model.rst page --- docs/server/source/appendices/index.rst | 1 - .../source/appendices/tx-yaml-files.rst | 34 ------------------- .../source/data-models/transaction-model.rst | 14 ++++++-- 3 files changed, 11 insertions(+), 38 deletions(-) delete mode 100644 docs/server/source/appendices/tx-yaml-files.rst diff --git a/docs/server/source/appendices/index.rst b/docs/server/source/appendices/index.rst index 6f560458..ae2052f0 100755 --- a/docs/server/source/appendices/index.rst +++ b/docs/server/source/appendices/index.rst @@ -28,5 +28,4 @@ Appendices install-with-lxd run-with-vagrant run-with-ansible - tx-yaml-files vote-yaml diff --git a/docs/server/source/appendices/tx-yaml-files.rst b/docs/server/source/appendices/tx-yaml-files.rst deleted file mode 100644 index 64ac751c..00000000 --- a/docs/server/source/appendices/tx-yaml-files.rst +++ /dev/null @@ -1,34 +0,0 @@ -The Transaction Schema Files -============================ - -BigchainDB checks all :ref:`transactions ` -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 -`"Understanding JSON Schema" -`_ -by Michael Droettboom or -`json-schema.org `_. - - -transaction_v1.0.yaml ---------------------- - -.. literalinclude:: ../../../../bigchaindb/common/schema/transaction_v1.0.yaml - :language: yaml - - -transaction_create_v1.0.yaml ----------------------------- - -.. literalinclude:: ../../../../bigchaindb/common/schema/transaction_create_v1.0.yaml - :language: yaml - - -transaction_transfer_v1.0.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 59f0357f..9a23b754 100644 --- a/docs/server/source/data-models/transaction-model.rst +++ b/docs/server/source/data-models/transaction-model.rst @@ -69,6 +69,14 @@ The Transaction Schema ---------------------- BigchainDB checks all transactions (JSON documents) -against a formal schema defined in :ref:`some JSON Schema files -(copied verbatim into the Appendices) -`. +against a formal schema defined +in some `JSON Schema `_ files. +Those files are part of the IPDB Protocol. +Their official source is the ``tx_schema/`` directory +in the `ipdb/ipdb-protocol repository on GitHub +`_, +but BigchainDB Server uses copies of those files; +those copies can be found +in the ``bigchaindb/common/schema/`` directory +in the `bigchaindb/bigchaindb repository on GitHub +`_. From 374b6301c61b8bb7acdce75536e7afefb16b8bc2 Mon Sep 17 00:00:00 2001 From: Troy McConaghy Date: Thu, 23 Nov 2017 16:21:19 +0100 Subject: [PATCH 2/2] In readme file about JSON Schema files, note provenance and update process --- bigchaindb/common/schema/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bigchaindb/common/schema/README.md b/bigchaindb/common/schema/README.md index 4b2cf873..76ff7f28 100644 --- a/bigchaindb/common/schema/README.md +++ b/bigchaindb/common/schema/README.md @@ -10,6 +10,16 @@ The aim is to provide: [implementations](http://json-schema.org/implementations.html) written in different languages) +## Sources + +The file defining the JSON Schema for votes (`vote.yaml`) is BigchainDB-specific. + +The files defining the JSON Schema for transactions (`transaction_*.yaml`) +are copied from the [IPDB Protocol](https://github.com/ipdb/ipdb-protocol). +If you want to add a new version, you must add it to the IPDB Protocol first. +(You can't change existing versions. Those were used to validate old transactions +and are needed to re-check those transactions.) + ## Learn about JSON Schema A good resource is [Understanding JSON Schema](http://spacetelescope.github.io/understanding-json-schema/index.html).