-
Notifications
You must be signed in to change notification settings - Fork 38
Description
This is a feature request 🙂
Currently, we're using the type generation with the option additionalProperties set to false so that our component types do not include any unknown properties. This has the consequence that the meta_data field on the Storyblok Asset type has this definition:
meta_data?: {};It's an object without any known fields. With our strict TS config, trying to use any property on the meta_data field (e.g. blok.image.meta_data?.our_field) causes a type error.
However, Storyblok allows adding arbitrary custom fields to asset metadata. For example, in our project, we use the MAPI to set a boolean field above_the_fold: true on some assets. We would like to somehow be able to define that the meta_data field on assets in our project has the type:
meta_data?: {
above_the_fold?: boolean
};Additionally, there are default metadata fields that the CMS supports out of the box and allow setting via the UI (see screenshot below).
It would be nice if users of the CLI could specify the exact type of their asset meta_data when generating types.
