We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ccf255 commit 0d6d552Copy full SHA for 0d6d552
src/handlers.ts
@@ -57,6 +57,9 @@ export default function (plop: NodePlopAPI) {
57
return [
58
async () => {
59
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
60
+ if (!pkg.name) {
61
+ throw new Error('Your package.json is missing a name field, please ensure it is set');
62
+ }
63
const svcName = pkg.name.split('/').pop();
64
const apiSpec = `api/${svcName}.yaml`;
65
const { paths } = await OpenAPIParser.validate(apiSpec);
0 commit comments