diff --git a/src/__tests__/__snapshots__/index.spec.tsx.snap b/src/__tests__/__snapshots__/index.spec.tsx.snap index d853e74b..f77c57e0 100644 --- a/src/__tests__/__snapshots__/index.spec.tsx.snap +++ b/src/__tests__/__snapshots__/index.spec.tsx.snap @@ -8,7 +8,7 @@ exports[`Expanded depth nested object static given initial level set to 0, shoul
-
+
object
@@ -21,7 +21,7 @@ exports[`Expanded depth nested object static given initial level set to 0, shoul
-
+
bar
object @@ -38,7 +38,7 @@ exports[`Expanded depth nested object static given initial level set to 0, shoul
-
+
foo
array of objects @@ -64,7 +64,7 @@ exports[`Expanded depth nested object static given initial level set to 1, shoul
-
+
object
@@ -77,7 +77,7 @@ exports[`Expanded depth nested object static given initial level set to 1, shoul
-
+
bar
object @@ -93,7 +93,7 @@ exports[`Expanded depth nested object static given initial level set to 1, shoul
-
+
barFoo
object @@ -144,7 +144,7 @@ exports[`Expanded depth nested object static given initial level set to 1, shoul
-
+
foo
array of objects @@ -203,7 +203,7 @@ exports[`Expanded depth nested object static given initial level set to 2, shoul
-
+
object
@@ -216,7 +216,7 @@ exports[`Expanded depth nested object static given initial level set to 2, shoul
-
+
bar
object @@ -232,7 +232,7 @@ exports[`Expanded depth nested object static given initial level set to 2, shoul
-
+
barFoo
object @@ -300,7 +300,7 @@ exports[`Expanded depth nested object static given initial level set to 2, shoul
-
+
foo
array of objects @@ -359,7 +359,7 @@ exports[`HTML Output given anyOf combiner placed next to allOf given allOf mergi
-
+
-
+
object
@@ -616,7 +616,7 @@ exports[`HTML Output given multiple object and string type, should process prope
-
+
string @@ -660,7 +660,7 @@ exports[`HTML Output given oneOf combiner placed next to allOf given allOf mergi
-
+
-
+
string @@ -852,7 +852,7 @@ exports[`HTML Output given standalone mode, should populate proper nodes 1`] = `
-
+
string @@ -914,7 +914,7 @@ exports[`HTML Output given visible $ref node, should try to inject the title imm
-
+
object
@@ -927,7 +927,7 @@ exports[`HTML Output given visible $ref node, should try to inject the title imm
-
+
foo
User @@ -961,7 +961,7 @@ exports[`HTML Output given visible $ref node, should try to inject the title imm
-
+
user
User @@ -987,7 +987,7 @@ exports[`HTML Output given write mode, should populate proper nodes 1`] = `
-
+
string @@ -1031,7 +1031,7 @@ exports[`HTML Output should match arrays/of-allofs.json 1`] = `
-
+
Test
@@ -1044,7 +1044,7 @@ exports[`HTML Output should match arrays/of-allofs.json 1`] = `
-
+
array-all-objects
array of objects @@ -1103,7 +1103,7 @@ exports[`HTML Output should match arrays/of-arrays.json 1`] = `
-
+
array of objects
@@ -1157,7 +1157,7 @@ exports[`HTML Output should match arrays/of-objects.json 1`] = `
-
+
object
@@ -1170,7 +1170,7 @@ exports[`HTML Output should match arrays/of-objects.json 1`] = `
-
+
propertyIsArrayOfObjects
array of objects @@ -1213,7 +1213,7 @@ exports[`HTML Output should match arrays/of-refs.json 1`] = `
-
+
$ref(./models/todo-full.json)[]
@@ -1248,7 +1248,7 @@ exports[`HTML Output should match arrays/with-multiple-arrayish-items.json 1`] =
-
+
array
@@ -1274,7 +1274,7 @@ exports[`HTML Output should match arrays/with-multiple-arrayish-items.json 1`] =
-
+
object
@@ -1348,7 +1348,7 @@ exports[`HTML Output should match arrays/with-ordered-items.json 1`] = `
-
+
array
@@ -1396,7 +1396,7 @@ exports[`HTML Output should match arrays/with-single-arrayish-items.json 1`] = `
-
+
array of objects
@@ -1468,7 +1468,7 @@ exports[`HTML Output should match combiners/allOfs/base.json 1`] = `
-
+
object
@@ -1481,7 +1481,7 @@ exports[`HTML Output should match combiners/allOfs/base.json 1`] = `
-
+
AllOfMergeObjects
object @@ -1570,7 +1570,7 @@ exports[`HTML Output should match combiners/allOfs/base.json 1`] = `
-
+
AllOfMergeObjectPropertyValidations
object @@ -1608,7 +1608,7 @@ exports[`HTML Output should match combiners/allOfs/base.json 1`] = `
-
+
AllOfMergeRefs
object @@ -1702,7 +1702,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
object
@@ -1715,7 +1715,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
foo
object @@ -1731,7 +1731,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
user
allOf @@ -1747,7 +1747,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
object
@@ -1760,7 +1760,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
names
@@ -1797,7 +1797,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
users
array of objects @@ -1813,7 +1813,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
creation
object @@ -1829,7 +1829,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
user
allOf @@ -1845,7 +1845,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
object
@@ -1858,7 +1858,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
names
@@ -1895,7 +1895,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
users
array of objects @@ -1912,7 +1912,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
@@ -1931,7 +1931,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
@@ -1950,7 +1950,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
object
@@ -2058,7 +2058,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
bar
object @@ -2074,7 +2074,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
foo
object @@ -2090,7 +2090,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
user
allOf @@ -2106,7 +2106,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
object
@@ -2119,7 +2119,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
names
@@ -2156,7 +2156,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
users
array of objects @@ -2172,7 +2172,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
creation
object @@ -2188,7 +2188,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
user
allOf @@ -2204,7 +2204,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
-
+
object
@@ -2277,7 +2277,7 @@ exports[`HTML Output should match combiners/allOfs/todo-full.json 1`] = `
-
+
array of Todo Partial-s
@@ -2404,7 +2404,7 @@ exports[`HTML Output should match combiners/allOfs/todo-full.json 1`] = `
-
+
user
User @@ -2471,7 +2471,7 @@ exports[`HTML Output should match combiners/allOfs/todo-full-2.json 1`] = `
-
+
Todo Full
@@ -2585,7 +2585,7 @@ exports[`HTML Output should match combiners/allOfs/with-type.json 1`] = `
-
+
-
+
-
+
-
+
User
@@ -3101,7 +3101,7 @@ exports[`HTML Output should match default-schema.json 1`] = `
-
+
plan
@@ -3190,7 +3190,7 @@ exports[`HTML Output should match default-schema.json 1`] = `
-
+
permissions
@@ -3228,7 +3228,7 @@ exports[`HTML Output should match default-schema.json 1`] = `
-
+
ref
@@ -3326,7 +3326,7 @@ exports[`HTML Output should match formats-schema.json 1`] = `
-
+
model-with-formats
@@ -3411,7 +3411,7 @@ exports[`HTML Output should match formats-schema.json 1`] = `
-
+
permissions
@@ -3459,7 +3459,7 @@ exports[`HTML Output should match references/base.json 1`] = `
-
+
object
@@ -3472,7 +3472,7 @@ exports[`HTML Output should match references/base.json 1`] = `
-
+
billing_address
object @@ -3541,7 +3541,7 @@ exports[`HTML Output should match references/base.json 1`] = `
-
+
shipping_address
object @@ -3619,7 +3619,7 @@ exports[`HTML Output should match references/nullish.json 1`] = `
-
+
object
@@ -3657,7 +3657,7 @@ exports[`HTML Output should match tickets.schema.json 1`] = `
-
+
object
@@ -3675,7 +3675,7 @@ exports[`HTML Output should match tickets.schema.json 1`] = `
-
+
availableTicketingOptions
$ref(../TicketingOptionInfo/TicketingOptionInfo.v1-0.yaml)[] @@ -3730,7 +3730,7 @@ exports[`HTML Output should match tickets.schema.json 1`] = `
-
+
ticketingOptionChoice
array of objects @@ -3786,7 +3786,7 @@ exports[`HTML Output should match tickets.schema.json 1`] = `
-
+
orderItemBreakdown
array of objects @@ -3824,7 +3824,7 @@ exports[`HTML Output should match tickets.schema.json 1`] = `
-
+
options
array of objects @@ -3918,7 +3918,7 @@ exports[`HTML Output should match tickets.schema.json 1`] = `
-
+
deliveryInfo
object diff --git a/src/__tests__/index.spec.tsx b/src/__tests__/index.spec.tsx index 01b9e03b..3350f324 100644 --- a/src/__tests__/index.spec.tsx +++ b/src/__tests__/index.spec.tsx @@ -243,7 +243,7 @@ describe('Expanded depth', () => {
-
+
array of objects
@@ -268,7 +268,7 @@ describe('Expanded depth', () => {
-
+
array of objects
@@ -281,7 +281,7 @@ describe('Expanded depth', () => {
-
+
foo
array of objects @@ -311,7 +311,7 @@ describe('Expanded depth', () => {
-
+
array of objects
@@ -324,7 +324,7 @@ describe('Expanded depth', () => {
-
+
foo
array of objects @@ -340,7 +340,7 @@ describe('Expanded depth', () => {
-
+
bar
object @@ -406,7 +406,7 @@ describe('Expanded depth', () => {
-
+
array of objects
@@ -431,7 +431,7 @@ describe('Expanded depth', () => {
-
+
array of objects
@@ -460,7 +460,7 @@ describe('Expanded depth', () => {
-
+
foo
array of objects @@ -490,7 +490,7 @@ describe('Expanded depth', () => {
-
+
array of objects
@@ -519,7 +519,7 @@ describe('Expanded depth', () => {
-
+
foo
array of objects @@ -629,7 +629,7 @@ describe('Expanded depth', () => {
-
+
object
@@ -712,7 +712,7 @@ describe('$ref resolving', () => {
-
+
$ref(#/foo)[]
diff --git a/src/components/JsonSchemaViewer.tsx b/src/components/JsonSchemaViewer.tsx index 058f8415..ddbe7b80 100644 --- a/src/components/JsonSchemaViewer.tsx +++ b/src/components/JsonSchemaViewer.tsx @@ -66,7 +66,7 @@ const JsonSchemaViewerComponent: React.FC diff --git a/src/components/SchemaRow/SchemaRow.tsx b/src/components/SchemaRow/SchemaRow.tsx index d2b4c60c..1793cbe2 100644 --- a/src/components/SchemaRow/SchemaRow.tsx +++ b/src/components/SchemaRow/SchemaRow.tsx @@ -75,16 +75,17 @@ export const SchemaRow: React.FunctionComponent = ({ schemaNode, ...(!isBrokenRef && nestingLevel === 0 ? { position: 'relative', + left: -1 * SCHEMA_ROW_OFFSET, } : { - left: CARET_ICON_BOX_DIMENSION * -1 + SCHEMA_ROW_OFFSET / -2, + left: CARET_ICON_BOX_DIMENSION * -1 - SCHEMA_ROW_OFFSET, }), }} size={CARET_ICON_SIZE} /> ) : null} -
+
{schemaNode.subpath.length > 0 && shouldShowPropertyName(schemaNode) && (
{last(schemaNode.subpath)}
)} @@ -110,7 +111,7 @@ export const SchemaRow: React.FunctionComponent = ({ schemaNode, ) : null} {schemaNode.subpath.length > 1 && schemaNode.subpath[0] === 'patternProperties' ? ( -
(pattern property)
+
(pattern property)
) : null} {choices.length > 1 && (
"`, + `"
"`, ); }); @@ -164,7 +164,7 @@ describe('Property component', () => { const wrapper = render(schema); expect(wrapper.html()).toMatchInlineSnapshot( - `"
array of objects
foo
bar
baz
"`, + `"
array of objects
foo
bar
baz
"`, ); }); @@ -199,12 +199,12 @@ describe('Property component', () => { let wrapper = render(schema, ['properties', 'array-all-objects', 'items', 'properties', 'foo']); expect(wrapper.html()).toMatchInlineSnapshot( - `"
foo
string
"`, + `"
foo
string
"`, ); wrapper = render(schema, ['properties', 'array-all-objects', 'items', 'properties', 'bar']); expect(wrapper.html()).toMatchInlineSnapshot( - `"
bar
string
"`, + `"
bar
string
"`, ); }); @@ -224,7 +224,7 @@ describe('Property component', () => { const wrapper = mount(); expect(wrapper.html()).toMatchInlineSnapshot( - `"
foo
object
"`, + `"
foo
object
"`, ); wrapper.unmount(); });