Skip to content

Commit b954ac9

Browse files
author
Carmine DiMascio
committed
(fix) Generator fails: error "swagger-express-middleware" is not found, when selecting OpenAPI #28
1 parent 73fe192 commit b954ac9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

app/index.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ module.exports = class extends Generator {
5050
{ name: 'OpenApi 3', value: 'openapi_3' },
5151
{ name: 'Swagger 2', value: 'swagger_2' },
5252
],
53+
default: 'openapi_3',
5354
},
5455
];
5556

@@ -103,14 +104,16 @@ module.exports = class extends Generator {
103104
};
104105

105106
if (this.specification === 'openapi_3') {
106-
copyOpts.globOptions.ignore.push('**/server/common/swagger.js');
107-
copyOpts.globOptions.ignore.push('**/server/common/api.v2.yml');
107+
copyOpts.globOptions.ignore.push(src + '/server/common/swagger.ts');
108+
copyOpts.globOptions.ignore.push(src + '/server/common/api.v2.yml');
108109
} else {
109110
files.push('server/common/api.v2.yml');
110-
copyOpts.globOptions.ignore.push('**/server/common/api.yml');
111+
copyOpts.globOptions.ignore.push(src + '/server/common/api.yml');
111112
}
112113
if (!this.docker) {
113-
copyOpts.globOptions.ignore.push('**/+(Dockerfile|.dockerignore)');
114+
copyOpts.globOptions.ignore.push(
115+
src + '/+(Dockerfile|.dockerignore)'
116+
);
114117
}
115118

116119
this.fs.copy(src, dest, copyOpts);

0 commit comments

Comments
 (0)