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
feat: allow users/plugins to modify and extend generated types for fields & config, add generated types for json field (#6984)
- Improves type for `jsonSchema` property of JSON field
- Adds type generation of JSON field with `jsonSchema`
- Adds `typescriptSchema` property to fields that allows you override
default field type generation by providing a JSON schema.
- Adds `typescript.schema` property in payload config, to allow for any
modifications of the type schemas
---------
Co-authored-by: Alessio Gravili <alessio@gravili.de>
|**`name`**\*| To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names)|
32
-
|**`label`**| Text used as the heading in the Admin panel or an object with keys for each language. Auto-generated from name if not defined. |
33
-
|**`fields`**\*| Array of field types to correspond to each row of the Array. |
34
-
|**`validate`**| Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation)|
35
-
|**`minRows`**| A number for the fewest allowed items during validation when a value is present. |
36
-
|**`maxRows`**| A number for the most allowed items during validation when a value is present. |
37
-
|**`saveToJWT`**| If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
38
-
|**`hooks`**| Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks)|
39
-
|**`access`**| Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control)|
40
-
|**`hidden`**| Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
41
-
|**`defaultValue`**| Provide an array of row data to be used for this field's default value. [More](/docs/fields/overview#default-values)|
42
-
|**`localized`**| Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. If enabled, a separate, localized set of all data within this Array will be kept, so there is no need to specify each nested field as `localized`. |
43
-
|**`required`**| Require this field to have a value. |
44
-
|**`labels`**| Customize the row labels appearing in the Admin dashboard. |
45
-
|**`admin`**| Admin-specific configuration. See below for [more detail](#admin-config). |
46
-
|**`custom`**| Extension point for adding custom data (e.g. for plugins) |
47
-
|**`interfaceName`**| Create a top level, reusable [Typescript interface](/docs/typescript/generating-types#custom-field-interfaces) & [GraphQL type](/docs/graphql/graphql-schema#custom-field-schemas). |
48
-
|**`dbName`**| Custom table name for the field when using SQL database adapter ([Postgres](/docs/database/postgres)). Auto-generated from name if not defined. |
|**`name`**\*| To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names)|
32
+
|**`label`**| Text used as the heading in the Admin panel or an object with keys for each language. Auto-generated from name if not defined. |
33
+
|**`fields`**\*| Array of field types to correspond to each row of the Array. |
34
+
|**`validate`**| Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation)|
35
+
|**`minRows`**| A number for the fewest allowed items during validation when a value is present. |
36
+
|**`maxRows`**| A number for the most allowed items during validation when a value is present. |
37
+
|**`saveToJWT`**| If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
38
+
|**`hooks`**| Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks)|
39
+
|**`access`**| Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control)|
40
+
|**`hidden`**| Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
41
+
|**`defaultValue`**| Provide an array of row data to be used for this field's default value. [More](/docs/fields/overview#default-values)|
42
+
|**`localized`**| Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. If enabled, a separate, localized set of all data within this Array will be kept, so there is no need to specify each nested field as `localized`. |
43
+
|**`required`**| Require this field to have a value. |
44
+
|**`labels`**| Customize the row labels appearing in the Admin dashboard. |
45
+
|**`admin`**| Admin-specific configuration. See below for [more detail](#admin-config). |
46
+
|**`custom`**| Extension point for adding custom data (e.g. for plugins) |
47
+
|**`interfaceName`**| Create a top level, reusable [Typescript interface](/docs/typescript/generating-types#custom-field-interfaces) & [GraphQL type](/docs/graphql/graphql-schema#custom-field-schemas). |
48
+
|**`dbName`**| Custom table name for the field when using SQL database adapter ([Postgres](/docs/database/postgres)). Auto-generated from name if not defined. |
49
+
|**`typescriptSchema`**| Override field type generation with providing a JSON schema |
49
50
50
51
_\* An asterisk denotes that a property is required._
0 commit comments