Skip to content

Array of types is not supported #380

@antoine-mulet

Description

@antoine-mulet

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".

image

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.

<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

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions