-
Notifications
You must be signed in to change notification settings - Fork 419
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
Unhelpful error message when defining an array of arrays #452
Comments
Yep, just ran into this. Even just "Invalid item "Item Name" type: "actualTypeName" is itself an array. Default array input can only contain objects (for now). |
Same. Creating an array of portableText arrays... is a core feature of any decent CMS. |
Looks like you can stuff a portable text or block array inside an object, and have an array of those objects from the document level. Not the worst work-around, but there may be some trouble with the fetching/rendering... |
I was having this same issue when building a site with a Page builder. Since every page is an array I need to nest an array of objects inside the page array for stuff like content grid implementations. After reading the above comments I went ahead and made the grid an object with a heading then an array of gridItems seemed to work. Although this is not what I wanted on the first draft it feels like the best shape now that I am looking at it. Can just always take an optional title and render it for screen readers if the design/marketing team does not want the section heading. Here is the schema that is working for me and feels pretty nice for my use case.
|
Defining an array of arrays triggers this rather unhelpful error in the Array input:
Until we get proper support for arrays of arrays, this should be a more instructive (and also a hard failure) at schema parse time.
Example schema definition:
The text was updated successfully, but these errors were encountered: