lukeautry / tsoa

Build OpenAPI-compliant REST APIs using TypeScript and Node
MIT License
3.56k stars 499 forks source link

Massive code duplication between router generation templates #487

Closed HoldYourWaffle closed 5 years ago

HoldYourWaffle commented 5 years ago

Sorting

Expected Behavior

You generally want to minimize code duplication to avoid maintenance and readability issues.

Current Behavior

Very large portions of express.hbs, hapi.hbs and koa.hbs are identical or have no functional difference.

Possible Solution

My first hunch would be to extract the common portion(s) into a separate "base" template. The router-specific parts can then be 'included' into this base template.

Breaking change?

Probably not because custom templates are not be affected by this change.

dgreene1 commented 5 years ago

Sure, we’d accept this refactor

github-actions[bot] commented 5 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days