Skip to content

Commit

Permalink
refactor: v -> def
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucky3028 committed Sep 26, 2023
1 parent 69e594b commit 76be6e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/auto-run-ac-api/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ app.openAPIRegistry.registerComponent('securitySchemes', 'basicAuth', { type: 'h

// NOTE: app#doc31と同等だが、一部処理を変更するために自分で実装
app.get('/docs', async (c) => {
const definitions = app.openAPIRegistry.definitions.map((v) => {
if (v.type === 'route') {
const definitions = app.openAPIRegistry.definitions.map((def) => {
if (def.type === 'route') {
// NOTE: なぜか勝手にパスの最後にスラッシュを追加してくるので、ここで削除
return { type: v.type, route: { ...v.route, path: v.route.path.replace(/\/$/, '') } };
return { type: def.type, route: { ...def.route, path: def.route.path.replace(/\/$/, '') } };
}

return v;
return def;
});
const generator = new OpenApiGeneratorV31(definitions);
const config = {
Expand Down

0 comments on commit 76be6e3

Please sign in to comment.