Skip to content

Commit

Permalink
Merge pull request #48 from zecar/option-display-full-path
Browse files Browse the repository at this point in the history
option to display full path
  • Loading branch information
ad-on-is authored Feb 27, 2024
2 parents 9464865 + 6c6ae72 commit 5c13f61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default {
headers: {}, // OpenAPI conform headers that are commonly used
},
persistAuthorization: true, // persist authorization between reloads on the swagger page
showFullPath: false, // the path displayed after endpoint summary
};
```

Expand Down
8 changes: 6 additions & 2 deletions src/autoswagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface options {
ignore: string[];
version: string;
path: string;
showFullPath: boolean;
tagIndex: number;
snakeCase: boolean;
common: common;
Expand Down Expand Up @@ -448,14 +449,17 @@ export class AutoSwagger {
break;
}
}

let summeryFilePath = sourceFile.replace("App/Controllers/Http/", "")
if (!this.options.showFullPath) {
summaryFilePath = sourceFile.replace(this.options.path, '')

Check failure on line 454 in src/autoswagger.ts

View workflow job for this annotation

GitHub Actions / Deploy

Cannot find name 'summaryFilePath'. Did you mean 'summeryFilePath'?
}
let m = {
summary:
sourceFile === "" && action == ""
? summary + " (route.ts)"
: summary +
" (" +
sourceFile.replace("App/Controllers/Http/", "") +
summaryFilePath +

Check failure on line 462 in src/autoswagger.ts

View workflow job for this annotation

GitHub Actions / Deploy

Cannot find name 'summaryFilePath'. Did you mean 'summeryFilePath'?
"::" +
action +
")",
Expand Down

0 comments on commit 5c13f61

Please sign in to comment.