Skip to content

Commit 6032728

Browse files
author
monica.lopez-gris
committed
fix: swagger path dasherize
1 parent a953e99 commit 6032728

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

packages/schematics/src/lib/swagger/swagger.factory.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { join, Path } from '@angular-devkit/core';
1+
import { join, Path, strings } from '@angular-devkit/core';
22
import { chain, Rule, Tree } from '@angular-devkit/schematics';
33
import {
44
addDecoratorToClassProp,
@@ -200,11 +200,16 @@ function updateMain(project: string) {
200200
}
201201

202202
export function swagger(options: { path?: string }): Rule {
203-
const projectPath = options.path || '.';
204-
return chain([
205-
updatePackageJson(projectPath),
206-
updateMain(projectPath),
207-
updateNestCliJson(projectPath),
208-
updateBaseEntity(projectPath),
209-
]);
203+
return (): any => {
204+
if (!options.path) {
205+
options.path = '.';
206+
}
207+
options.path = strings.dasherize(options.path);
208+
return chain([
209+
updatePackageJson(options.path),
210+
updateMain(options.path),
211+
updateNestCliJson(options.path),
212+
updateBaseEntity(options.path),
213+
]);
214+
};
210215
}

0 commit comments

Comments
 (0)