Skip to content

Commit a60a6d3

Browse files
authored
fix: handling nested schemas with allof (#128)
1 parent 5e8af68 commit a60a6d3

File tree

4 files changed

+85
-5
lines changed

4 files changed

+85
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"dependencies": {
4444
"@fortawesome/free-solid-svg-icons": "^5.15.2",
4545
"@stoplight/json": "^3.10.0",
46-
"@stoplight/json-schema-tree": "^1.1.2",
46+
"@stoplight/json-schema-tree": "^1.1.3",
4747
"@stoplight/mosaic": "^1.0.0-beta.36",
4848
"@stoplight/react-error-boundary": "^1.0.0",
4949
"classnames": "^2.2.6",
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$ref": "#/__bundled__/repo",
3+
"__bundled__": {
4+
"repo": {
5+
"properties": {
6+
"parent": {
7+
"allOf": [
8+
{
9+
"$ref": "#/__bundled__/repo"
10+
},
11+
{
12+
"description": "something"
13+
}
14+
]
15+
}
16+
},
17+
"type": "object"
18+
}
19+
}
20+
}
21+

src/__tests__/__snapshots__/index.spec.tsx.snap

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3249,6 +3249,65 @@ exports[`HTML Output should match references/base.json 1`] = `
32493249
"
32503250
`;
32513251
3252+
exports[`HTML Output should match references/nested.json 1`] = `
3253+
"<div class=\\"\\">
3254+
<div class=\\"JsonSchemaViewer\\">
3255+
<div style=\\"margin-left: 20px\\">
3256+
<div>
3257+
<div>
3258+
<div>
3259+
<div>
3260+
<div style=\\"width: 20px; height: 20px; position: relative; left: -7px\\" role=\\"button\\"></div>
3261+
<div><span>object</span></div>
3262+
</div>
3263+
</div>
3264+
</div>
3265+
<div></div>
3266+
</div>
3267+
<div>
3268+
<div style=\\"margin-left: 20px\\">
3269+
<div>
3270+
<div>
3271+
<div>
3272+
<div>
3273+
<div style=\\"width: 20px; height: 20px; left: -27px\\" role=\\"button\\"></div>
3274+
<div>
3275+
<div>parent</div>
3276+
<span>object</span>
3277+
</div>
3278+
</div>
3279+
<div><div title=\\"something\\">something</div></div>
3280+
</div>
3281+
</div>
3282+
<div></div>
3283+
</div>
3284+
<div>
3285+
<div style=\\"margin-left: 20px\\">
3286+
<div>
3287+
<div>
3288+
<div>
3289+
<div>
3290+
<div style=\\"width: 20px; height: 20px; left: -27px\\" role=\\"button\\"></div>
3291+
<div>
3292+
<div>parent</div>
3293+
<span>object</span>
3294+
</div>
3295+
</div>
3296+
<div><div title=\\"something\\">something</div></div>
3297+
</div>
3298+
</div>
3299+
<div></div>
3300+
</div>
3301+
</div>
3302+
</div>
3303+
</div>
3304+
</div>
3305+
</div>
3306+
</div>
3307+
</div>
3308+
"
3309+
`;
3310+
32523311
exports[`HTML Output should match references/nullish.json 1`] = `
32533312
"<div class=\\"\\">
32543313
<div class=\\"JsonSchemaViewer\\">

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,10 +2265,10 @@
22652265
json-schema-compare "^0.2.2"
22662266
lodash "^4.17.4"
22672267

2268-
"@stoplight/json-schema-tree@^1.1.2":
2269-
version "1.1.2"
2270-
resolved "https://registry.yarnpkg.com/@stoplight/json-schema-tree/-/json-schema-tree-1.1.2.tgz#c781de4322f286b296fe82233dd4b895cedb10a7"
2271-
integrity sha512-GgEJApU2/JKVd3XwjPP52gI9EGCi1nFz4fPUTw1gafpAnEqQcjVF14RFlJ+YjMx15ggwsUPCDEZIypDEoYvdoA==
2268+
"@stoplight/json-schema-tree@^1.1.3":
2269+
version "1.1.3"
2270+
resolved "https://registry.yarnpkg.com/@stoplight/json-schema-tree/-/json-schema-tree-1.1.3.tgz#c2aafa1b10c506e7ebec7a4904ff3bd325f7102f"
2271+
integrity sha512-n/mmhLEu4qrZO/UxQBYyPNid2v4Zq6fuzUK9pBMpNxQtxXmmge62lFWDnc3Q8nzXwRio0OPuMmZS9RO0Q0hmOg==
22722272
dependencies:
22732273
"@stoplight/json" "^3.10.0"
22742274
"@stoplight/json-schema-merge-allof" "^0.7.5"

0 commit comments

Comments
 (0)