From dfc2a45ff94d8787f7a745373cd8386debe266df Mon Sep 17 00:00:00 2001 From: MengT Date: Mon, 4 Dec 2023 17:06:21 +0800 Subject: [PATCH] Doc: add sphinx extension for json schema --- .vscode/settings.json | 5 ----- docs/.sphinx/requirements.txt | 1 + docs/conf.py | 3 ++- docs/reference/index.rst | 1 + docs/reference/submission-schema.rst | 17 +++++++++++++++++ docs/tutorial/using-checkbox/test-report.rst | 6 ++++-- 6 files changed, 25 insertions(+), 8 deletions(-) delete mode 100644 .vscode/settings.json create mode 100644 docs/reference/submission-schema.rst diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index a836b007c..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "[markdown]": { - "editor.formatOnSave": false - } -} diff --git a/docs/.sphinx/requirements.txt b/docs/.sphinx/requirements.txt index d5b529367..35c8c1c35 100644 --- a/docs/.sphinx/requirements.txt +++ b/docs/.sphinx/requirements.txt @@ -13,3 +13,4 @@ lxd-sphinx-extensions sphinx-copybutton myst-parser setuptools-scm +sphinx-jsonschema diff --git a/docs/conf.py b/docs/conf.py index 8f67f90d7..479fbbc3f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -52,7 +52,8 @@ 'terminal-output', 'sphinx_copybutton', 'sphinxext.opengraph', - 'myst_parser' + 'myst_parser', + 'sphinx-jsonschema' ] myst_enable_extensions = [ diff --git a/docs/reference/index.rst b/docs/reference/index.rst index f7ec118fb..4ee37a766 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -10,3 +10,4 @@ Reference launcher units/index snaps + submission-schema diff --git a/docs/reference/submission-schema.rst b/docs/reference/submission-schema.rst new file mode 100644 index 000000000..742d2eeeb --- /dev/null +++ b/docs/reference/submission-schema.rst @@ -0,0 +1,17 @@ +.. _submission_schema: + +Submission Schema +================== + +Checkbox :ref:`Submission files ` provide a summary of the test results and in-depth information that help analyzing the tests. + +This document describes the schema the ``submission.json`` files that's sent to the `Certification website `_ as part of the submission. To get the latest schema definition file in Json, go to the Checkbox `GitHub repository `_. + +.. important:: + + The schema described in this document is work-in-progress and being reviewed. If you need assistance in validating the schema, please contact the Checkbox team. + +.. jsonschema:: ../../submission-schema/schema.json + :lift_definitions: + :auto_reference: + \ No newline at end of file diff --git a/docs/tutorial/using-checkbox/test-report.rst b/docs/tutorial/using-checkbox/test-report.rst index 4275a56ac..bdb620d10 100644 --- a/docs/tutorial/using-checkbox/test-report.rst +++ b/docs/tutorial/using-checkbox/test-report.rst @@ -133,8 +133,10 @@ in the search bar, you can view all test results related to audio testing. The xz compressed tarball is a comprehensive archive that includes the aforementioned reports and all associated attachments, such as I/O logs and binary files. You can extract the tarball with ``tar -xf - sumbission.tar.xz -C /path/to/destination``. + submission.tar.xz -C /path/to/destination``. Certification Website only accepts submissions tarballs, from which it extracts the ``submission.json`` file to create a new test report in the - database. \ No newline at end of file + database. + +For a detailed description of the ``submission.json`` file, see the :doc:`../../reference/submission-schema` reference.