Skip to content

Commit

Permalink
fix: combiners with differing types render nothing for some children (#…
Browse files Browse the repository at this point in the history
…222)

* fix: combiners with differing types render nothing for some children

* fix: prettier updates
  • Loading branch information
BelfordZ authored and P0lip committed May 30, 2023
1 parent 58dfd15 commit df0780b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/__stories__/Combiners.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ OneOfMulti.args = { schema: oneOfWithMultiTypesSchema, renderRootTreeLines: true
export const ArrayOneOf2 = Template.bind({});
ArrayOneOf2.args = { schema: oneOfWithArraySchema2 as JSONSchema4, renderRootTreeLines: true };

export const OneOfMulti = Template.bind({});
OneOfMulti.args = { schema: oneOfWithMultiTypesSchema, renderRootTreeLines: true };

export const ObjectAnyOf = Template.bind({});
ObjectAnyOf.args = { schema: anyOfObject as JSONSchema4 };
7 changes: 7 additions & 0 deletions src/__tests__/__snapshots__/index.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,13 @@ exports[`HTML Output given array with oneOf containing items, should merge it co
</div>
<div>(one of)</div>
</div>
<div data-id=\\"b55b1e932485c\\">
<div>
<div>
<div><span>array[string]</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/components/SchemaRow/TopLevelSchemaRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ export const TopLevelSchemaRow = ({
currentNestingLevel={nestingLevel}
parentNodeId={nodeId}
/>
) : combiner ? (
<SchemaRow schemaNode={selectedChoice.type} nestingLevel={nestingLevel} />
) : null}
</>
);
Expand Down

0 comments on commit df0780b

Please sign in to comment.