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
Copy file name to clipboardExpand all lines: versioned_docs/version-3.x/recipe/plugin-dev.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,10 @@ You can also package a plugin as an npm package. Make sure to export the "plugin
20
20
21
21
The following example shows a sample plugin that allows you to mark fields as "password" and specify hashing algorithms to use.
22
22
23
+
:::info
24
+
Custom attributes and functions by themselves don't have any effect. They are commonly combined with other plugin aspects to achieve a meaningful goal, like we'll see in the next sections.
The following types can be used for attribute parameters and function parameters and returns:
49
+
50
+
- String
51
+
- Int
52
+
- Float
53
+
- Boolean
54
+
- DateTime
55
+
- Object
56
+
- Any
57
+
58
+
A parameter can be set optional by suffixing its type with a `?`.
59
+
42
60
## Generating custom artifacts
43
61
44
62
The `zen` CLI is extensible via plugins and allows you to generate custom artifacts from the ZModel schema. To continue the previous example, let's create a very simple CLI plugin that generates a markdown document listing all model fields marked as passwords.
0 commit comments