github lukeautry/tsoa v3.0.5

latest releases: v6.2.1, v6.2.0, v6.1.5...
pre-release4 years ago

New Reference Documentation

Remaining planned breaking changes:

- swagger.(json|yaml)
+ openapi.(json|yaml)

We are planning to offer a setting to change the name of the generated OAS file.

Track the Status of the overall progress towards a stable 3.0 here

Fixed bugs:

  • Aliased void Api Response types document 200 response instead of 204 #629 (WoH)
  • ValidateError should extend Error #661 (aldenquimby)

New Features:

Breaking Changes:

  • Use Spec instead of Swagger (tsoa swagger is still available for now, but will be removed eventually) #664 (WoH)
Calling the tsoa command
- tsoa swagger
+ tsoa spec

- tsoa swagger-and-routes
+ tsoa spec-and-routes

Manually calling spec generation
- await generateSwaggerSpec(swaggerConfig, routesConfig, compilerOptions, config.ignore);
+ await generateSpec(openapiConfig, compilerOptions, config.ignore);

tsoa.json:

{
  "swagger": {}
}

becomes

{
  "spec": {}
}
  • Move shared config to top level #628 (WoH)

Instead of duplicating config and handling a lot of edge cases, the new config is a lot simpler.
Config settings, that impact both routes and spec are now located at the top level of the config object.

{
    "entryFile": "./tests/fixtures/express/server.ts",
    "noImplicitAdditionalProperties": "silently-remove-extras",
    "routes": {},
    "spec": {}
}

This means if your settings are different (for example the entry file), you'll have to call the generateRoutes() and generateSpec() yourself.
Note that these methods now have a simpler config aswell:

-    await generateSwaggerSpec(swaggerConfig, routesConfig, compilerOptions, config.ignore);
+    await generateSpec(openapiConfig, compilerOptions, config.ignore);
-    await generateRoutes(routesConfig, swaggerConfig, compilerOptions, config.ignore);
+    await generateRoutes(routesConfig, compilerOptions, config.ignore);

EntryFile and noImplicitAdditionalProperties can now be set on the swagger/routesConfig.

Also, boolean settings for noImplicitAdditionalProperties have been removed: #503
Valid settings are now: 'throw-on-extras' | 'silently-remove-extras' | 'ignore', everything else falls back to 'ignore'.

For reference, see the TS interface of the entire config here

Don't miss a new tsoa release

NewReleases is sending notifications on new releases.