@mettlecast/domain-cli 0.2.8 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,7 +33,7 @@ function isZod(v) {
33
33
  return v && typeof v === 'object' && typeof v.parse === 'function' && typeof v.safeParse === 'function' && v._def !== undefined;
34
34
  }
35
35
  function toJsonSchema(v) {
36
- try { return z.toJSONSchema(v); } catch { /* skip unserializable */ }
36
+ try { return z.toJSONSchema(v); } catch { return { type: 'null' }; }
37
37
  }
38
38
  function strip(obj) {
39
39
  const out = {};
@@ -148,16 +148,10 @@ export async function runValidate(domainRoot, exitOnFailure = true, config = { m
148
148
  return Array.isArray(examples) && examples.length > 0;
149
149
  }
150
150
  if (api.requestSchema && !hasExampleOrDefault(api.requestSchema)) {
151
- errors.push({
152
- code: 'MISSING_API_REQUEST_EXAMPLE',
153
- message: `API '${api.id}' (${api.method} ${api.path}) request schema has no example data. Add .default({...}) to your Zod schema.`,
154
- });
151
+ warnings.push(`API '${api.id}' (${api.method} ${api.path}) request schema has no example data. Add .default({...}) to your Zod schema.`);
155
152
  }
156
153
  if (api.responseSchema && !hasExampleOrDefault(api.responseSchema)) {
157
- errors.push({
158
- code: 'MISSING_API_RESPONSE_EXAMPLE',
159
- message: `API '${api.id}' (${api.method} ${api.path}) response schema has no example data. Add .default({...}) to your Zod schema.`,
160
- });
154
+ warnings.push(`API '${api.id}' (${api.method} ${api.path}) response schema has no example data. Add .default({...}) to your Zod schema.`);
161
155
  }
162
156
  }
163
157
  const rawPathErrors = await checkRawPathViolations(registry.domainRoot, config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mettlecast/domain-cli",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",
@@ -50,7 +50,7 @@ function isZod(v) {
50
50
  return v && typeof v === 'object' && typeof v.parse === 'function' && typeof v.safeParse === 'function' && v._def !== undefined;
51
51
  }
52
52
  function toJsonSchema(v) {
53
- try { return z.toJSONSchema(v); } catch { /* skip unserializable */ }
53
+ try { return z.toJSONSchema(v); } catch { return { type: 'null' }; }
54
54
  }
55
55
  function strip(obj) {
56
56
  const out = {};
@@ -202,16 +202,10 @@ export async function runValidate(
202
202
  return Array.isArray(examples) && examples.length > 0;
203
203
  }
204
204
  if (api.requestSchema && !hasExampleOrDefault(api.requestSchema)) {
205
- errors.push({
206
- code: 'MISSING_API_REQUEST_EXAMPLE',
207
- message: `API '${api.id}' (${api.method} ${api.path}) request schema has no example data. Add .default({...}) to your Zod schema.`,
208
- });
205
+ warnings.push(`API '${api.id}' (${api.method} ${api.path}) request schema has no example data. Add .default({...}) to your Zod schema.`);
209
206
  }
210
207
  if (api.responseSchema && !hasExampleOrDefault(api.responseSchema)) {
211
- errors.push({
212
- code: 'MISSING_API_RESPONSE_EXAMPLE',
213
- message: `API '${api.id}' (${api.method} ${api.path}) response schema has no example data. Add .default({...}) to your Zod schema.`,
214
- });
208
+ warnings.push(`API '${api.id}' (${api.method} ${api.path}) response schema has no example data. Add .default({...}) to your Zod schema.`);
215
209
  }
216
210
  }
217
211