-
-
Notifications
You must be signed in to change notification settings - Fork 746
Expose collections config & schemas via a useContent composable #3672
Copy link
Copy link
Open
Labels
Description
While working on validating field formats against the generated JSON Schema, I found it difficult to access or inspect the schema associated with a collection.
It would be very helpful to have a composable such as useContent that could return:
- the list of available collections
- the JSON Schema associated with each collection
This would greatly simplify:
- schema validation during development
- testing edge cases (e.g.
datevsdatetime) - building custom tooling on top of Nuxt Content / Studio
What I tried
I attempted to access the collections directly using:
import { collections } from '#content/preview'but without success, this resulted in an error and didn’t seem to be supported in this context.
Reactions are currently unavailable