Skip to content

Commit

Permalink
feat: display json-pointer and level in SchemaItem
Browse files Browse the repository at this point in the history
  • Loading branch information
jy95 committed Dec 31, 2023
1 parent a886362 commit 72b1b95
Show file tree
Hide file tree
Showing 10 changed files with 572 additions and 143 deletions.
90 changes: 72 additions & 18 deletions __tests__/JSONSchemaViewer/__snapshots__/array.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ exports[`JSONSchemaViewer - Array type test 1 1`] = `
array
</span>
<ul>
<li>
<li
data-level={1}
id="/contains"
>
<details
open={false}
>
Expand Down Expand Up @@ -144,7 +147,10 @@ exports[`JSONSchemaViewer - Array type test 2 1`] = `
array
</span>
<ul>
<li>
<li
data-level={1}
id="/items"
>
<details
open={false}
>
Expand Down Expand Up @@ -281,7 +287,10 @@ exports[`JSONSchemaViewer - Array type test 4 1`] = `
array
</span>
<ul>
<li>
<li
data-level={1}
id="/contains"
>
<details
open={false}
>
Expand Down Expand Up @@ -386,7 +395,10 @@ exports[`JSONSchemaViewer - Array type test 5 1`] = `
array
</span>
<ul>
<li>
<li
data-level={1}
id="/prefixItems/0"
>
<details
open={false}
>
Expand Down Expand Up @@ -440,7 +452,10 @@ exports[`JSONSchemaViewer - Array type test 5 1`] = `
</div>
</details>
</li>
<li>
<li
data-level={1}
id="/prefixItems/1"
>
<details
open={false}
>
Expand Down Expand Up @@ -494,7 +509,10 @@ exports[`JSONSchemaViewer - Array type test 5 1`] = `
</div>
</details>
</li>
<li>
<li
data-level={1}
id="/prefixItems/2"
>
<details
open={false}
>
Expand Down Expand Up @@ -572,7 +590,10 @@ exports[`JSONSchemaViewer - Array type test 5 1`] = `
</div>
</details>
</li>
<li>
<li
data-level={1}
id="/prefixItems/3"
>
<details
open={false}
>
Expand Down Expand Up @@ -657,7 +678,10 @@ exports[`JSONSchemaViewer - Array type test 5 1`] = `
</li>
</ul>
<ul>
<li>
<li
data-level={1}
id="/items"
>
<details
open={false}
>
Expand Down Expand Up @@ -986,7 +1010,10 @@ exports[`JSONSchemaViewer - Array type test 11 1`] = `
array
</span>
<ul>
<li>
<li
data-level={1}
id="/items/0"
>
<details
open={false}
>
Expand Down Expand Up @@ -1031,7 +1058,10 @@ exports[`JSONSchemaViewer - Array type test 11 1`] = `
</div>
</details>
</li>
<li>
<li
data-level={1}
id="/items/1"
>
<details
open={false}
>
Expand Down Expand Up @@ -1124,7 +1154,10 @@ exports[`JSONSchemaViewer - Array type test 12 1`] = `
array
</span>
<ul>
<li>
<li
data-level={1}
id="/prefixItems/0"
>
<details
open={false}
>
Expand Down Expand Up @@ -1173,7 +1206,10 @@ exports[`JSONSchemaViewer - Array type test 12 1`] = `
</div>
</details>
</li>
<li>
<li
data-level={1}
id="/prefixItems/1"
>
<details
open={false}
>
Expand Down Expand Up @@ -1270,7 +1306,10 @@ exports[`JSONSchemaViewer - Array type test 13 1`] = `
array
</span>
<ul>
<li>
<li
data-level={1}
id="/items"
>
<details
open={false}
>
Expand Down Expand Up @@ -1408,7 +1447,10 @@ exports[`JSONSchemaViewer - Array type test 15 1`] = `
array
</span>
<ul>
<li>
<li
data-level={1}
id="/items/0"
>
<details
open={false}
>
Expand Down Expand Up @@ -1457,7 +1499,10 @@ exports[`JSONSchemaViewer - Array type test 15 1`] = `
</div>
</details>
</li>
<li>
<li
data-level={1}
id="/items/1"
>
<details
open={false}
>
Expand Down Expand Up @@ -1508,7 +1553,10 @@ exports[`JSONSchemaViewer - Array type test 15 1`] = `
</li>
</ul>
<ul>
<li>
<li
data-level={1}
id="/additionalItems"
>
<details
open={false}
>
Expand Down Expand Up @@ -1605,7 +1653,10 @@ exports[`JSONSchemaViewer - Array type test 16 1`] = `
array
</span>
<ul>
<li>
<li
data-level={1}
id="/prefixItems/0"
>
<details
open={false}
>
Expand Down Expand Up @@ -1652,7 +1703,10 @@ exports[`JSONSchemaViewer - Array type test 16 1`] = `
</li>
</ul>
<ul>
<li>
<li
data-level={1}
id="/unevaluatedItems"
>
<details
open={false}
>
Expand Down
25 changes: 20 additions & 5 deletions __tests__/JSONSchemaViewer/__snapshots__/constructor.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ exports[`JSONSchemaViewer - constructor Overwrite default UnresolvedRefsComponen
object
</span>
<ul>
<li>
<li
data-level={1}
id="/properties/data"
>
<details
open={false}
>
Expand Down Expand Up @@ -125,7 +128,10 @@ exports[`JSONSchemaViewer - constructor Overwrite default UnresolvedRefsComponen
</div>
</details>
</li>
<li>
<li
data-level={1}
id="/properties/children"
>
<details
open={false}
>
Expand Down Expand Up @@ -164,7 +170,10 @@ exports[`JSONSchemaViewer - constructor Overwrite default UnresolvedRefsComponen
array
</span>
<ul>
<li>
<li
data-level={2}
id="/properties/children/items"
>
<details
open={false}
>
Expand Down Expand Up @@ -272,7 +281,10 @@ exports[`JSONSchemaViewer - constructor Overwrite default ValueComponent value 1
object
</span>
<ul>
<li>
<li
data-level={1}
id="/properties/customField"
>
<details
open={false}
>
Expand Down Expand Up @@ -402,7 +414,10 @@ exports[`JSONSchemaViewer - constructor Overwrite default ValueComponent value 1
</div>
</details>
</li>
<li>
<li
data-level={1}
id="/properties/customConstObject"
>
<details
open={false}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ exports[`JSONSchemaViewer - corner cases CreateArray - invalid usage of Addition
array
</span>,
<ul>
<li>
<li
data-level={1}
id="/items"
>
<details
open={false}
>
Expand Down Expand Up @@ -63,7 +66,10 @@ exports[`JSONSchemaViewer - corner cases CreateArray - invalid usage of Addition
</li>
</ul>,
<ul>
<li>
<li
data-level={1}
id="/additionalItems"
>
<details
open={false}
>
Expand Down Expand Up @@ -135,7 +141,10 @@ exports[`JSONSchemaViewer - corner cases CreateArray - sub properties as boolean
array
</span>,
<ul>
<li>
<li
data-level={1}
id="/prefixItems"
>
<details
open={false}
>
Expand Down Expand Up @@ -184,7 +193,10 @@ exports[`JSONSchemaViewer - corner cases CreateArray - sub properties as boolean
</li>
</ul>,
<ul>
<li>
<li
data-level={1}
id="/items"
>
<details
open={false}
>
Expand Down Expand Up @@ -233,7 +245,10 @@ exports[`JSONSchemaViewer - corner cases CreateArray - sub properties as boolean
</li>
</ul>,
<ul>
<li>
<li
data-level={1}
id="/contains"
>
<details
open={false}
>
Expand Down
Loading

0 comments on commit 72b1b95

Please sign in to comment.