bowtie-json-schema / bowtie

JSON Schema in every programming language
https://bowtie.report/
Other
52 stars 40 forks source link

Configurably or automatically show `registry` contents in reports and summaries #224

Open Julian opened 1 year ago

Julian commented 1 year ago

When a test has a registry (i.e. additional schemas that were used during validation), it's not possible right now to see what those were/are when looking at summarized output in bowtie summary, nor in bowtie report HTML output.

An example of a command where schemas have a registry sent alongside them is:

bowtie suite -i python-jsonschema https://github.com/json-schema-org/JSON-Schema-Test-Suite/tree/main/tests/draft7/refRemote.json

If you run that command and have a look at the registry variable in the report template, e.g. by adding this:

diff --git a/bowtie/templates/report.html.j2 b/bowtie/templates/report.html.j2
index 1539759..41b46ec 100644
--- a/bowtie/templates/report.html.j2
+++ b/bowtie/templates/report.html.j2
@@ -280,6 +280,9 @@
         <div id="case-{{ seq }}" class="accordion-collapse collapse" aria-labelledby="case-{{ seq }}-heading"
           data-bs-parent="#cases">
           <div id="accordion-body{{ seq }}" class="accordion-body">
+
+            <pre>{{ registry | tojson(indent=2) }}</pre>
+
             <table class="table table-hover">
               <thead>
                 <tr>

you'll see a big blob -- a mapping between URIs and schemas -- which is the registry for each test case.

nomandhoni-cs commented 1 year ago

I hope to do this in next or next++ PR.

dante381 commented 1 year ago

Hey @nomandhoni-cs , If you are not currently working on this issue, Please let me know. I am interested in solving this issue.

nomandhoni-cs commented 1 year ago

@dante381 Sure, Give it a shot! It would be better If you keep updating your progress!

dante381 commented 1 year ago

Hey @Julian, Could you provide a command that uses additional schemas

Julian commented 1 year ago

@dante381 yes definitely! I added some detail to the issue description, let me know if that helps!