sanity
sanity copied to clipboard
Schema validation incorrectly allows multiple string types
Describe the bug
See https://github.com/sanity-io/sanity/issues/3627
Apparently we do not disallow using multiple different string types in an array, which we shouldn't. This issue is about addressing this and giving a helpful error message to the user.
Marking this as both a v2 and v3 issue until we can confirm/disprove that this is an issue in both.
To Reproduce
Steps to reproduce the behavior:
- Make an array schema type/field with multiple string options:
{
title: 'Content',
name: 'content',
type: 'array',
of: [
{
title: 'Heading',
name: 'heading',
type: 'string',
},
{
title: 'Subheading',
name: 'subheading',
type: 'string',
},
{
title: 'Paragraph',
name: 'paragraph',
type: 'text',
},
],
},
- See the studio try to render an array that allows all the different types
Expected behavior
The studio should give a schema error disallowing it.
Screenshots
Which versions of Sanity are you using?
Run sanity versions
in the terminal and copy-paste the result here.
What operating system are you using?
Which versions of Node.js / npm are you running?
@sanity/cli 2.30.0 (latest: 2.32.0)
@sanity/base 2.33.0 (up to date)
@sanity/core 2.33.0 (up to date)
@sanity/default-layout 2.33.0 (up to date)
@sanity/default-login 2.33.0 (up to date)
@sanity/desk-tool 2.33.0 (up to date)
@sanity/orderable-document-list 0.0.3 (latest: 0.0.10)
@sanity/vision 2.33.0 (up to date)