-
-
Notifications
You must be signed in to change notification settings - Fork 603
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
Error for sidebar entries that match multiple entry schemas #2031
Conversation
🦋 Changeset detectedLatest commit: e87c1f7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
size-limit report 📦
|
Aren't you thinking of Altho, I have to say I've never seen anyone even trying to extend this schema personally so I think the slightly better DX (knowing the index of the sidebar item with an issue is already a good addition imo) makes sense. |
IIRC when I last tried, z
.object({ a: z.string() })
.strict()
.extend({ b: z.string() })
.parse({ a: 'A', b: 'B' })
// ^ Fails because `b` is not permitted in the initial strict object Anyway we don’t really support extending the user config now I think about, only frontmatter schema. So should indeed be fine. |
Description
{ label: 'Foo', link: '/bar/', items: [] }
matched theSidebarLinkItemSchema
(it had alabel
and alink
) and was considered valid withitems
being ignored.Considerations
z.object({}).strict().extend({ ... })
, because the.strict()
is already baked in at that point. In practice, extending the sidebar schema may already be too difficult for anyone to be doing it? Still, would want some feedback on whether this is a change we definitely want, or if we’re happy with the loose parsing and to mark Conflicting sidebar options are silently ignored #2019 as working as expected.