-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Hi,
It seems that having an array of types (which is valid json schema) is not supported by this tool. For example "type": ["string", "null"] is displayed as "stringnull".
After taking a quick look at the code I believe the problem is coming from the following piece where the assumption is made that type is always a single value.
docs-react/src/JSONSchema/SchemaRenderer.tsx
Lines 172 to 175 in f8a233b
| <TableCell style={{ | |
| ...styles.cellWidth, | |
| color: colorMap[schema.type as any], | |
| }}>{schema.type}</TableCell> |
Using an array of types is particularly convenient to define a simple nullable type like a nullable string for example. A workaround is to use oneOf but this is a bit more verbose so it would be nice to support array of types I think.
Thanks,
Antoine
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
