@mettlecast/domain-cli 0.2.12 → 0.2.14
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.
|
@@ -139,7 +139,8 @@ export async function runValidate(domainRoot, exitOnFailure = true, config = { m
|
|
|
139
139
|
message: `API '${api.id}' (${api.method} ${api.path}) has invalid method "${api.method}". Use one of: ${[...VALID_METHODS].join(', ')}.`,
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
const isVoidInput = api.requestSchema?.type === 'null';
|
|
143
|
+
if (!isVoidInput && !api.examples?.request) {
|
|
143
144
|
errors.push({
|
|
144
145
|
code: 'MISSING_API_REQUEST_EXAMPLE',
|
|
145
146
|
message: `API '${api.id}' (${api.method} ${api.path}) has no request example. Add examples: { request: {...}, response: {...} } to the defineApi config.`,
|
package/package.json
CHANGED
package/src/commands/validate.ts
CHANGED
|
@@ -195,7 +195,8 @@ export async function runValidate(
|
|
|
195
195
|
message: `API '${api.id}' (${api.method} ${api.path}) has invalid method "${api.method}". Use one of: ${[...VALID_METHODS].join(', ')}.`,
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
|
-
|
|
198
|
+
const isVoidInput = api.requestSchema?.type === 'null';
|
|
199
|
+
if (!isVoidInput && !api.examples?.request) {
|
|
199
200
|
errors.push({
|
|
200
201
|
code: 'MISSING_API_REQUEST_EXAMPLE',
|
|
201
202
|
message: `API '${api.id}' (${api.method} ${api.path}) has no request example. Add examples: { request: {...}, response: {...} } to the defineApi config.`,
|