freshcrate
Skin:/
Home > Frameworks > tsoa-next

tsoa-next

Build type-safe OpenAPI APIs for Node.js using TypeScript decorators with automatic spec generation and validation

Why this rank:Release freshnessHealthy release cadenceStrong adoption

Description

Build type-safe OpenAPI APIs for Node.js using TypeScript decorators with automatic spec generation and validation

README

tsoa-next logo tsoa-next

Pronounced soยทuh

OpenAPI-compliant REST APIs using TypeScript and Node

build status npm version Quality Gate Status

Project Lineage

tsoa-next continues the original tsoa project. The original repository and its contributors established the stable TypeScript-first and OpenAPI-first foundation this work builds on. Where historical release notes or migration references still point upstream, they are kept intentionally for provenance.

Goal

  • TypeScript controllers and models as the single source of truth for your API
  • A valid OpenAPI (formerly Swagger) 2.0, 3.0, or 3.1 spec is generated from your controllers and models, including:
    • Paths (e.g. GET /users)
    • Definitions based on TypeScript interfaces (models)
    • Parameters/model properties marked as required or optional based on TypeScript (e.g. myProperty?: string is optional in the OpenAPI spec)
    • jsDoc supported for object descriptions (most other metadata can be inferred from TypeScript types)
  • Routes are generated for middleware of choice
    • Express, Hapi, and Koa currently supported, other middleware can be supported using a simple handlebars template
    • Validate request payloads

Philosophy

  • Rely on TypeScript type annotations to generate API metadata if possible
  • If regular type annotations aren't an appropriate way to express metadata, use decorators
  • Use jsdoc for pure text metadata (e.g. endpoint descriptions)
  • Minimize boilerplate
  • Models are best represented by interfaces (pure data structures), but can also be represented by classes
  • Runtime validation of tsoa-next should behave as closely as possible to the specifications that the generated OpenAPI schema describes. Any differences in validation logic are clarified by logging warnings during the generation of the OpenAPI Specification (OAS) and/or the routes.
    • Please note that by enabling OpenAPI 3.0 or 3.1 you minimize the chances of divergent validation logic since the newer schema shapes are more expressive than OpenAPI 2.0.

Feature List

  • Generate OpenAPI 2.0, 3.0, or 3.1 documents directly from your TypeScript controllers, models, and JSDoc comments.
  • Treat TypeScript controllers and models as the source of truth for paths, parameters, schemas, examples, tags, and security metadata.
  • Generate framework-specific route handlers for Express, Koa, and Hapi, or supply your own Handlebars templates for custom runtimes.
  • Validate request input at runtime with configurable coercion and additional-property handling that stays aligned with the generated schema.
  • Expose controller-local spec endpoints with @SpecPath(...) without reading a generated spec file from local disk at request time.
  • Serve built-in json, yaml, swagger, redoc, and rapidoc spec targets, with docs UI packages loaded lazily as optional peers when available.
  • Attach multiple @SpecPath(...) decorators to the same controller as long as their resolved paths are unique.
  • Cache built-in or custom spec responses with 'none', in-process 'memory', or a custom cache handler that can read from strings or streams.
  • Return either string or Readable responses from custom @SpecPath(...) handlers for bespoke documentation or downstream integrations.
  • Use @Validate(...) to delegate runtime validation to supported external schema libraries such as zod, joi, yup, superstruct, or io-ts.
  • Customize validation translation and failure formatting through the optional validation context accepted by generated RegisterRoutes(...) functions.
  • Support authentication hooks, dependency injection, typed alternate responders, file uploads, custom middleware, and custom validation workflows.
  • Use the tsoa CLI for spec and route generation, or call the programmatic APIs from tsoa-next/cli.
  • Target modern Node.js releases with the support policy verified in CI across the previous LTS, current LTS, and Node vNext.

Getting Started

Package Surface

  • Import decorators, runtime helpers, and generated route support from tsoa-next
  • Import programmatic generation APIs from tsoa-next/cli
  • Use the tsoa binary for CLI generation commands

Examples

Check out the guides

Use the companion playground repository for runnable example apps and server-focused scenarios.

See example controllers in the tests

See example models in the tests

Help wanted

Contributing code

To contribute (via a PR), please first see the Contributing Guide

Release History

VersionChangesUrgencyDate
tsoa-next@8.2.2### Patch Changes - 5d3e303: Fixed generated `@SpecPath(...)` routes so they register before regular controller routes in the Express, Koa, and Hapi templates. This prevents dynamic first-segment routes such as `/{tenant}/{resource}` from shadowing spec endpoints like `/SpecPath/spec`. Refreshed the docs site and API reference to ship from one VitePress pipeline with `typedoc-plugin-markdown`, grouped install snippets, generated `llms.txt` output, published changelog pages, syntax-highliHigh4/17/2026
@tsoa-next/runtime@8.2.2### Patch Changes - 5d3e303: Fixed generated `@SpecPath(...)` routes so they register before regular controller routes in the Express, Koa, and Hapi templates. This prevents dynamic first-segment routes such as `/{tenant}/{resource}` from shadowing spec endpoints like `/SpecPath/spec`. Refreshed the docs site and API reference to ship from one VitePress pipeline with `typedoc-plugin-markdown`, grouped install snippets, generated `llms.txt` output, published changelog pages, syntax-highliHigh4/17/2026
@tsoa-next/cli@8.2.2### Patch Changes - 5d3e303: Fixed generated `@SpecPath(...)` routes so they register before regular controller routes in the Express, Koa, and Hapi templates. This prevents dynamic first-segment routes such as `/{tenant}/{resource}` from shadowing spec endpoints like `/SpecPath/spec`. Refreshed the docs site and API reference to ship from one VitePress pipeline with `typedoc-plugin-markdown`, grouped install snippets, generated `llms.txt` output, published changelog pages, syntax-highliHigh4/17/2026
@tsoa-next/cli@8.2.1### Patch Changes - a32e6e2: Fix live `@SpecPath(...)` serving for compiled deployments that do not ship controller source files. Generated routes now embed the OpenAPI artifact and metadata needed for built-in spec endpoints, so live spec responses no longer depend on runtime controller glob resolution. This also keeps generated route imports aligned with embedded-spec usage and preserves normal spec-generation options when building embedded specs. Additional follow-up fixes keep tHigh4/16/2026
tsoa-next@8.2.1### Patch Changes - a32e6e2: Fix live `@SpecPath(...)` serving for compiled deployments that do not ship controller source files. Generated routes now embed the OpenAPI artifact and metadata needed for built-in spec endpoints, so live spec responses no longer depend on runtime controller glob resolution. This also keeps generated route imports aligned with embedded-spec usage and preserves normal spec-generation options when building embedded specs. Additional follow-up fixes High4/16/2026
@tsoa-next/runtime@8.2.1### Patch Changes - a32e6e2: Fix live `@SpecPath(...)` serving for compiled deployments that do not ship controller source files. Generated routes now embed the OpenAPI artifact and metadata needed for built-in spec endpoints, so live spec responses no longer depend on runtime controller glob resolution. This also keeps generated route imports aligned with embedded-spec usage and preserves normal spec-generation options when building embedded specs. Additional follow-up fixes keep tHigh4/16/2026
@tsoa-next/runtime@8.2.0### Minor Changes - 8a8ff5b: Improve `@SpecPath(...)` support by adding the `@SpecPath(path, options?)` signature with `target`, `cache`, and request-aware `gate` controls. Generated Express, Koa, and Hapi routes now omit `SpecPath` support when no controller uses the decorator, and statically gated spec routes are skipped during registration. Medium4/14/2026
@tsoa-next/cli@8.2.0### Minor Changes - 8a8ff5b: Improve `@SpecPath(...)` support by adding the `@SpecPath(path, options?)` signature with `target`, `cache`, and request-aware `gate` controls. Generated Express, Koa, and Hapi routes now omit `SpecPath` support when no controller uses the decorator, and statically gated spec routes are skipped during registration. ### Patch Changes - Updated dependencies [8a8ff5b] - @tsoa-next/runtime@8.2.0 Medium4/14/2026
tsoa-next@8.2.0### Minor Changes - 8a8ff5b: Improve `@SpecPath(...)` support by adding the `@SpecPath(path, options?)` signature with `target`, `cache`, and request-aware `gate` controls. Generated Express, Koa, and Hapi routes now omit `SpecPath` support when no controller uses the decorator, and statically gated spec routes are skipped during registration. ### Patch Changes - Updated dependencies [8a8ff5b] - @tsoa-next/cli@8.2.0 - @tsoa-next/runtime@8.2.0 High4/14/2026
tsoa-next@8.1.0### Minor Changes - 84bb4a6: Add repeatable `@SpecPath(...)` controller decorators for serving OpenAPI documents and documentation UIs directly from generated routes without reading a local spec file at request time. This release adds: - Built-in `json`, `yaml`, `swagger`, `redoc`, and `rapidoc` `@SpecPath(...)` targets - Lazy in-memory spec generation for built-in spec routes through `createOpenApiSpecGenerator(...)` - Support for multiple `@SpecPath(...)` decorators High4/12/2026
@tsoa-next/cli@8.1.0### Minor Changes - 84bb4a6: Add repeatable `@SpecPath(...)` controller decorators for serving OpenAPI documents and documentation UIs directly from generated routes without reading a local spec file at request time. This release adds: - Built-in `json`, `yaml`, `swagger`, `redoc`, and `rapidoc` `@SpecPath(...)` targets - Lazy in-memory spec generation for built-in spec routes through `createOpenApiSpecGenerator(...)` - Support for multiple `@SpecPath(...)` decorators Medium4/12/2026
@tsoa-next/runtime@8.1.0### Minor Changes - 84bb4a6: Add repeatable `@SpecPath(...)` controller decorators for serving OpenAPI documents and documentation UIs directly from generated routes without reading a local spec file at request time. This release adds: - Built-in `json`, `yaml`, `swagger`, `redoc`, and `rapidoc` `@SpecPath(...)` targets - Lazy in-memory spec generation for built-in spec routes through `createOpenApiSpecGenerator(...)` - Support for multiple `@SpecPath(...)` decorators Medium4/12/2026
@tsoa-next/cli@8.0.5### Patch Changes - 2c0aa7c: Add CLI config discovery with `tsoa discover` and `--discover` support, lazy-load generation code for faster CLI startup, and make GitHub package publishing explicitly tag `tsoa-next` as `latest`. - Updated dependencies [2c0aa7c] - @tsoa-next/runtime@8.0.5 Medium4/12/2026
tsoa-next@8.0.5### Patch Changes - 2c0aa7c: Add CLI config discovery with `tsoa discover` and `--discover` support, lazy-load generation code for faster CLI startup, and make GitHub package publishing explicitly tag `tsoa-next` as `latest`. - Updated dependencies [2c0aa7c] - @tsoa-next/cli@8.0.5 - @tsoa-next/runtime@8.0.5 Medium4/12/2026
@tsoa-next/runtime@8.0.5### Patch Changes - 2c0aa7c: Add CLI config discovery with `tsoa discover` and `--discover` support, lazy-load generation code for faster CLI startup, and make GitHub package publishing explicitly tag `tsoa-next` as `latest`. Medium4/12/2026
tsoa-next@8.0.4### Patch Changes - 9fdb94a: Fixed inherited route detection for derived controllers whose base class imports `Controller` from `tsoa-next`. - 464a0c7: Fixed metadata generation for inherited generic controller routes and `io-ts` request aliases used in real-world controller setups. Also reduced repeated CLI generation work while resolving inherited methods and imported validator types. - Updated dependencies [9fdb94a] - Updated dependencies [464a0c7] - @tsoa-next/cli@8.0.4 - High4/9/2026
@tsoa-next/runtime@8.0.4 Medium4/9/2026
@tsoa-next/cli@8.0.4### Patch Changes - 9fdb94a: Fixed inherited route detection for derived controllers whose base class imports `Controller` from `tsoa-next`. - 464a0c7: Fixed metadata generation for inherited generic controller routes and `io-ts` request aliases used in real-world controller setups. Also reduced repeated CLI generation work while resolving inherited methods and imported validator types. - @tsoa-next/runtime@8.0.4 Medium4/9/2026
@tsoa-next/runtime@8.0.3 Medium4/9/2026
@tsoa-next/cli@8.0.3### Patch Changes - 4fd4531: Fixes metadata spec generation for JSDoc comments. - @tsoa-next/runtime@8.0.3 Medium4/9/2026
tsoa-next@8.0.3### Patch Changes - Updated dependencies [4fd4531] - @tsoa-next/cli@8.0.3 - @tsoa-next/runtime@8.0.3 Medium4/9/2026
@tsoa-next/runtime@8.0.2### Patch Changes - 63e57e3: Remediate the Sonar cleanup pass across the CLI and runtime without changing the public API surface. This patch keeps the existing exported contracts intact while reducing internal complexity, preserving legacy compatibility paths, and tightening integration and unit assertions around the affected behavior. High4/4/2026
tsoa-next@8.0.2### Patch Changes - a051324: Remediate the remaining metadata resolver quality issues without changing the public API surface. This patch keeps the existing CLI contracts intact while reducing internal complexity, tightening default parsing behavior, and adding focused tests that lock in the non-breaking behavior. - 63e57e3: Remediate the Sonar cleanup pass across the CLI and runtime without changing the public API surface. This patch keeps the existing exported contracts intact Medium4/4/2026
@tsoa-next/cli@8.0.2### Patch Changes - a051324: Remediate the remaining metadata resolver quality issues without changing the public API surface. This patch keeps the existing CLI contracts intact while reducing internal complexity, tightening default parsing behavior, and adding focused tests that lock in the non-breaking behavior. - 63e57e3: Remediate the Sonar cleanup pass across the CLI and runtime without changing the public API surface. This patch keeps the existing exported contracts intact Medium4/4/2026
tsoa-next@8.0.1### Patch Changes - 61f5454: Stop defaulting generated OpenAPI specs to an MIT license when the consumer package does not declare a `license` field. - Updated dependencies [61f5454] - @tsoa-next/cli@8.0.1 - @tsoa-next/runtime@8.0.1 Medium4/1/2026
@tsoa-next/runtime@8.0.1### Patch Changes - 61f5454: Stop defaulting generated OpenAPI specs to an MIT license when the consumer package does not declare a `license` field. Medium4/1/2026
@tsoa-next/cli@8.0.1### Patch Changes - 61f5454: Stop defaulting generated OpenAPI specs to an MIT license when the consumer package does not declare a `license` field. - Updated dependencies [61f5454] - @tsoa-next/runtime@8.0.1 Medium4/1/2026
@tsoa-next/cli@8.0.0### Patch Changes - @tsoa-next/runtime@8.0.0 Medium4/1/2026
@tsoa-next/runtime@8.0.0 Medium4/1/2026
tsoa-next@8.0.0### Major Changes - e942a31: Make `tsoa-next` root runtime-only and move programmatic generation exports to `tsoa-next/cli` so runtime imports do not eagerly load CLI dependencies. ### Patch Changes - @tsoa-next/cli@8.0.0 - @tsoa-next/runtime@8.0.0 Medium4/1/2026
@tsoa-next/runtime@7.3.4### Patch Changes - b5a952b: Trigger a development publish from the main-branch dev build workflow so downstream projects can validate prerelease packages before the next public release. - 0bd572e: Restore backward compatibility for nested module tsoa configs and route generation so downstream projects can validate the fixes in a dev build before the next public release. - 8be0961: Fix backward-compatible metadata and schema generation for imported aliases, generic aliases, and inherited Medium3/31/2026
@tsoa-next/cli@7.3.4### Patch Changes - b5a952b: Trigger a development publish from the main-branch dev build workflow so downstream projects can validate prerelease packages before the next public release. - 0bd572e: Restore backward compatibility for nested module tsoa configs and route generation so downstream projects can validate the fixes in a dev build before the next public release. - 8be0961: Fix backward-compatible metadata and schema generation for imported aliases, generic aliases, and inherited Medium3/31/2026
tsoa-next@7.3.4### Patch Changes - b5a952b: Trigger a development publish from the main-branch dev build workflow so downstream projects can validate prerelease packages before the next public release. - 0bd572e: Restore backward compatibility for nested module tsoa configs and route generation so downstream projects can validate the fixes in a dev build before the next public release. - 8be0961: Fix backward-compatible metadata and schema generation for imported aliases, generic aliases, and inherited Medium3/31/2026
tsoa-next@7.3.3### Patch Changes - 1eabe79: Fixes backward compatibility - Updated dependencies [1eabe79] - @tsoa-next/cli@7.3.3 - @tsoa-next/runtime@7.3.3 Medium3/30/2026
@tsoa-next/cli@7.3.3### Patch Changes - 1eabe79: Fixes backward compatibility - @tsoa-next/runtime@7.3.3 Medium3/30/2026
@tsoa-next/runtime@7.3.3 Medium3/30/2026
tsoa-next@7.3.2### Patch Changes - Updated dependencies [0eea2bc] - @tsoa-next/cli@7.3.2 - @tsoa-next/runtime@7.3.2 Medium3/30/2026
@tsoa-next/runtime@7.3.2 Medium3/30/2026
@tsoa-next/cli@7.3.2### Patch Changes - 0eea2bc: Resolves security issues and improves code quality - @tsoa-next/runtime@7.3.2 Medium3/30/2026
@tsoa-next/runtime@7.3.1### Patch Changes - 56c6b54: Refresh the release publish workflow to run on Node 24 so npm trusted publishing can authenticate with OIDC during npm publishes. Medium3/29/2026
tsoa-next@7.3.1### Patch Changes - 56c6b54: Refresh the release publish workflow to run on Node 24 so npm trusted publishing can authenticate with OIDC during npm publishes. - Updated dependencies [56c6b54] - @tsoa-next/cli@7.3.1 - @tsoa-next/runtime@7.3.1 Medium3/29/2026
@tsoa-next/cli@7.3.1### Patch Changes - 56c6b54: Refresh the release publish workflow to run on Node 24 so npm trusted publishing can authenticate with OIDC during npm publishes. - Updated dependencies [56c6b54] - @tsoa-next/runtime@7.3.1 Medium3/29/2026
@tsoa-next/cli@7.2.1### Patch Changes - 255ffd4: Fixes reported security issues - Updated dependencies [255ffd4] - @tsoa-next/runtime@7.2.1 Low3/22/2026
tsoa-next@7.2.1### Patch Changes - 255ffd4: Fixes reported security issues - Updated dependencies [255ffd4] - @tsoa-next/cli@7.2.1 - @tsoa-next/runtime@7.2.1 Low3/22/2026
@tsoa-next/runtime@7.2.1### Patch Changes - 255ffd4: Fixes reported security issues Low3/22/2026
@tsoa-next/cli@7.1.0### Minor Changes - 9ad742e: This is a forced release ### Patch Changes - 46e88e2: Force release - Updated dependencies [46e88e2] - Updated dependencies [9ad742e] - @tsoa-next/runtime@7.1.0 Low3/21/2026
@tsoa-next/runtime@7.1.0### Minor Changes - 9ad742e: This is a forced release ### Patch Changes - 46e88e2: Force release Low3/21/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

typesharpTypeSharp CLI - Automatically generate TypeScript from C# models. Keep your frontend and backend types in perfect sync! Supports nullable types, enums, inheritance, arrays, and custom naming conventiov0.2.3
aiagentflowA local-first, CLI-driven multi-agent AI software engineering workflow orchestrator with feed specs, PRDs, and guidelines to auto-generate implementation plans and code.v1.4.0
in-concertFull, scalable BPMN 2.0 enginemain@2026-05-22
CoalesceQuickly build amazing web apps6.5.1
risolutoAI-powered orchestrator that turns Linear issues into working code โ€” autonomous coding agents, real-time dashboard, and seamless GitHub integrationv0.9.0

More in Frameworks

deer-flowAn open-source long-horizon SuperAgent harness that researches, codes, and creates. With the help of sandboxes, memories, tools, skill, subagents and message gateway, it handles different levels of ta
ctranslate2Fast inference engine for Transformer models
schemathesisProperty-based testing framework for Open API and GraphQL based apps
spec_driven_developSpec-Driven Develop is a platform-agnostic AI agent skill that automates the pre-development workflow for large-scale complex tasks. It is not a framework, not a runtime, not a package manager โ€” it is