Skip to content

Commit ccba5b2

Browse files
Change: API sorting call moved
Previously the "API Sort" (by name) was done in API Write service. Now is launched after parse all APIs (just before than write).
1 parent 97fa919 commit ccba5b2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/services/parsers/open-api-v3/api-parser.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export class APIParserService extends ParserBaseService {
1919
this.parseVerbs(rawModel, url);
2020
console.groupEnd();
2121
}
22+
this.store.apis.sort();
2223
console.groupEnd();
2324
}
2425

src/services/writters/api-writter.service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class ApiWritterService {
2222
const folder = this.configuration.outputApisPath;
2323
makeDir(folder);
2424

25-
const groups = this.store.apis.sort().apisGrouped;
25+
const groups = this.store.apis.apisGrouped;
2626
for (const groupName in groups) {
2727
const apis = groups[groupName];
2828
const exportFileName = `${groupName}.${this.exportExtension}`;
@@ -39,7 +39,9 @@ export class ApiWritterService {
3939
}
4040

4141
private prepareMustacheInstance(): void {
42-
this.mustacheTemplate = getTemplate(this.configuration.templateConfig.apiFile);
42+
this.mustacheTemplate = getTemplate(
43+
this.configuration.templateConfig.apiFile,
44+
);
4345
mustache.parse(this.mustacheTemplate);
4446
this.exportExtension = this.configuration.templateConfig.apiExtension;
4547
}

0 commit comments

Comments
 (0)