You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
For the development of the new website for the 3D printing conference Printed-Amsterdam, I chose Nuxt 3 with @nuxt/content in combination with Nuxt Studio. This setup was intended to provide an intuitive and user-friendly experience, especially for non-technical users.
However, while creating the data schema, I encountered two fundamental missing features:
Content files with type == data schemas are not validated (this enhancement issue).
It would be helpful if, during the build process, all files within the content folder were validated. Since all collections are already loaded during the build, it would be feasible to crawl the corresponding source folders, open all related files, and validate them against a schema - if one is provided.
Currently, it's possible to define a content config like this:
And include a file like /content/talks/foo.json with the following content:
{
"title": 2
}
This file passes through the build without errors and is even included in the SQLite database under the talks collection. However, this should not happen: the description field is missing - even though it's required - and the title field is a number instead of a string.
Describe alternatives you've considered
Validating a collection's schema against all its files naturally incurs a performance cost. However, skipping validation allows errors to slip through easily and makes scaling with @nuxt/content more difficult.
A possible solution would be to make schema validation optional - controlled via a flag or configuration option. For example, validation could be enabled in feature branches via CI workflows, enforced as a required step before merging, and disabled on the main branch to speed up regular builds.
Additional context
None.
The text was updated successfully, but these errors were encountered:
Thanks for the issue @toddeTV
Build validation and nested schemas are in the module roadamp. The first step for these features is to move from Zod to a general solution, which is started in #3347
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe
For the development of the new website for the 3D printing conference Printed-Amsterdam, I chose Nuxt 3 with @nuxt/content in combination with Nuxt Studio. This setup was intended to provide an intuitive and user-friendly experience, especially for non-technical users.
However, while creating the data schema, I encountered two fundamental missing features:
type == data
schemas are not validated (this enhancement issue).The code is available in this open-source repository for the community:
https://github.com/toddeTV/printed-amsterdam.com
Describe the solution you'd like
It would be helpful if, during the build process, all files within the
content
folder were validated. Since all collections are already loaded during the build, it would be feasible to crawl the corresponding source folders, open all related files, and validate them against a schema - if one is provided.Currently, it's possible to define a content config like this:
And include a file like
/content/talks/foo.json
with the following content:This file passes through the build without errors and is even included in the SQLite database under the
talks
collection. However, this should not happen: thedescription
field is missing - even though it's required - and thetitle
field is a number instead of a string.Describe alternatives you've considered
Validating a collection's schema against all its files naturally incurs a performance cost. However, skipping validation allows errors to slip through easily and makes scaling with @nuxt/content more difficult.
A possible solution would be to make schema validation optional - controlled via a flag or configuration option. For example, validation could be enabled in feature branches via CI workflows, enforced as a required step before merging, and disabled on the
main
branch to speed up regular builds.Additional context
None.
The text was updated successfully, but these errors were encountered: