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
-**useZodForMocks** (boolean): Use Zod for mock generation instead of the custom runtime. Default: `false`.
106
-
-**useStaticMocks** (boolean): Generate static mock builders without runtime dependencies. When enabled, generates hardcoded mock values based on schema types. Default: `false`.
107
-
-**output** (string): Output filename (without extension) for the generated builders. Default: `'builders'`.
108
-
109
117
## Mock Generation Strategies
110
118
111
119
### Custom Runtime (Default)
112
120
113
121
The default strategy uses a lightweight custom mock generator that supports all JSON Schema features without external dependencies. This provides fast, predictable mock data generation.
114
122
115
123
```typescript
124
+
// Configuration
125
+
defineBuildersConfig({
126
+
mockStrategy: 'runtime', // or omit for default
127
+
})
128
+
129
+
// Usage
116
130
import { UserBuilder } from'./client/builders';
117
131
118
132
const user =newUserBuilder()
@@ -129,7 +143,7 @@ Features:
129
143
130
144
### Static Mocks
131
145
132
-
When `useStaticMocks: true` is enabled, the plugin generates hardcoded mock values directly in the builder classes. This approach:
146
+
When `mockStrategy: 'static'` is configured, the plugin generates hardcoded mock values directly in the builder classes. This approach:
133
147
134
148
-**No runtime generation** - All values are pre-computed at build time
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "hey-api-builders",
3
-
"version": "0.7.0",
3
+
"version": "0.8.1",
4
4
"description": "A custom plugin for @hey-api/openapi-ts that generates mock data builders with a lightweight custom runtime, Zod integration, or static mock generation.",
0 commit comments