Skip to content

Commit 528e669

Browse files
gabrielclaudinoGabriel Henrique Claudino
and
Gabriel Henrique Claudino
authored
fix: scalar types should not have a chevron icon indicating you can expand it (#99)
Co-authored-by: Gabriel Henrique Claudino <[email protected]>
1 parent df40be9 commit 528e669

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

filters/all.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function isExpandable(obj) {
1414
(fun(obj.additionalProperties) && obj.additionalProperties()) ||
1515
(fun(obj.extensions) && obj.extensions() &&
1616
Object.keys(obj.extensions()).filter(e => !e.startsWith("x-parser-")).length) ||
17-
(fun(obj.patternProperties) && obj.patternProperties())
17+
(fun(obj.patternProperties) && Object.keys(obj.patternProperties()).length)
1818
) return true;
1919

2020
return false;

test/all.is_expandable.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const {isExpandable} = require("../filters/all");
44
test.beforeEach(t => {
55
t.context.doc = {};
66
t.context.types = [{ type: "string" }, { type: "number" }];
7+
t.context.doc.patternProperties = () => ({});
78
});
89

910
test("isExpandable when the object type is object", t => {

0 commit comments

Comments
 (0)