Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array of types is not supported #380

Open
antoine-mulet opened this issue Oct 5, 2020 · 0 comments
Open

Array of types is not supported #380

antoine-mulet opened this issue Oct 5, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@antoine-mulet
Copy link

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

@shanejonas shanejonas added the bug Something isn't working label Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants