Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions src/__fixtures__/combiners/oneof-with-multi-types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"title": "a",
"oneOf": [
{
"title": "b",
"type": "object",
"properties": {
"c": {
"title": "d",
"type": "string"
},
"e": {
"title": "e",
"type": "string"
}
}
},
{
"title": "f",
"type": "boolean"
},
{
"title": "g",
"oneOf": [
{
"title": "h",
"type": "string"
},
{
"title": "l",
"type": "object",
"properties": {
"foo": {
"title": "k",
"oneOf": [
{
"title": "m",
"type": "string"
},
{
"title": "o",
"type": "object",
"properties": {
"foo": { "type": "string" }
}
}
]
}
}
}
]
}
]
}
4 changes: 4 additions & 0 deletions src/__stories__/Combiners.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const allOfSchema = require('../__fixtures__/combiners/allOfs/base.json');
const allOfComplexSchema = require('../__fixtures__/combiners/allOfs/complex.json');
const oneOfWithArraySchema = require('../__fixtures__/combiners/oneof-with-array-type.json');
const oneOfWithArraySchema2 = require('../__fixtures__/combiners/oneof-within-array-item.json');
const oneOfWithMultiTypesSchema = require('../__fixtures__/combiners/oneof-with-multi-types.json');
const anyOfObject = require('../__fixtures__/combiners/anyOf.json');

export default {
Expand All @@ -32,5 +33,8 @@ ArrayOneOf.args = { schema: oneOfWithArraySchema as JSONSchema4, renderRootTreeL
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 };
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