{"id":49586,"library":"typescript-rest-swagger-plural","title":"typescript-rest-swagger-plural","description":"A temporary fork of typescript-rest-swagger (v0.0.40) that adds support for pluralizing endpoints within class/controller inheritance. It generates Swagger/OpenAPI documentation from TypeScript REST APIs built with the typescript-rest framework. The original library is stable but this fork addresses a specific limitation around endpoint naming. It uses decorators like @Tags, @Response, @Example, and @Security to enrich generated specs. No known release cadence; last published in 2019. Differentiators: resolver for pluralization in inherited controllers compared to the base library.","status":"deprecated","version":"0.0.40","language":"javascript","source_language":"en","source_url":"https://github.com/thiagobustamante/typescript-rest-swagger","tags":["javascript","typescript","typescript-rest","swagger","open api","rest","microservice","codegen","generation"],"install":[{"cmd":"npm install typescript-rest-swagger-plural","lang":"bash","label":"npm"},{"cmd":"yarn add typescript-rest-swagger-plural","lang":"bash","label":"yarn"},{"cmd":"pnpm add typescript-rest-swagger-plural","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; the library generates swagger docs for typescript-rest controllers","package":"typescript-rest","optional":false}],"imports":[{"note":"ESM or CJS both work; the library is not ESM-only.","wrong":"const swaggerGen = require('typescript-rest-swagger-plural')","symbol":"swaggerGen","correct":"import { swaggerGen } from 'typescript-rest-swagger-plural'"},{"note":"Tags decorator is re-exported from this fork.","wrong":"import { Tags } from 'typescript-rest-swagger'","symbol":"Tags","correct":"import { Tags } from 'typescript-rest-swagger-plural'"},{"note":"Type parameter optional: @Response<string>(200, 'desc')","wrong":null,"symbol":"Response","correct":"import { Response } from 'typescript-rest-swagger-plural'"},{"note":"Used to provide example values for responses.","wrong":null,"symbol":"Example","correct":"import { Example } from 'typescript-rest-swagger-plural'"}],"quickstart":{"code":"// swaggerConfig.json\n{\n  \"swagger\": {\n    \"outputDirectory\": \"./dist\",\n    \"entryFile\": \"./src/controllers.ts\"\n  }\n}\n\n// terminal\nnpx swaggerGen -c ./swaggerConfig.json\n\n// src/controllers.ts\nimport { Path, GET } from 'typescript-rest';\nimport { Tags } from 'typescript-rest-swagger-plural';\n\n@Path('user')\nexport class UserController {\n  @GET\n  @Tags('Users')\n  getUsers(): string[] {\n    return ['Alice', 'Bob'];\n  }\n}","lang":"typescript","description":"Shows how to configure and run swaggerGen to generate OpenAPI spec from a typescript-rest controller with pluralized endpoint support."},"warnings":[{"fix":"Switch to typescript-rest-swagger (original) or consider rewriting with tsoa.","message":"This is a temporary fork of typescript-rest-swagger and is no longer maintained. Use the original package or migrate to a more modern alternative like tsoa or @nestjs/swagger.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Ensure all imports reference 'typescript-rest-swagger-plural' explicitly.","message":"Importing from 'typescript-rest-swagger' instead of 'typescript-rest-swagger-plural' will not include the pluralization fix and may cause runtime errors if using inherited controllers.","severity":"breaking","affected_versions":"<0.0.40"},{"fix":"Create a valid swaggerConfig.json with both fields.","message":"The swaggerGen command must be invoked with a config file that specifies both 'outputDirectory' and 'entryFile'. Missing these will cause a silent failure or empty output.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Add JSDoc comments to all controller methods and parameters.","message":"JSDoc on methods and parameters is used for descriptions in the generated swagger file. Missing JSDoc leads to incomplete documentation.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use a more actively maintained tool like tsoa or @nestjs/swagger.","message":"Package has not been updated since 2019 and may have compatibility issues with newer Node.js versions.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'2019':74 'add':16 'address':47 'api':31,94 'around':51 'base':85 'built':32 'cadenc':70 'class/controller':22 'codegen':97 'compar':82 'control':81 'decor':56 'differenti':75 'document':27 'endpoint':20,52 'enrich':64 'exampl':60 'fork':8,46 'framework':38 'generat':25,65,98 'inherit':23,80 'javascript':87 'known':68 'last':71 'librari':41,86 'like':57 'limit':50 'microservic':96 'name':53 'open':93 'origin':40 'plural':5,19,78 'publish':72 'releas':69 'resolv':76 'respons':59 'rest':3,12,30,37,91,95 'secur':62 'spec':66 'specif':49 'stabl':43 'support':17 'swagger':4,13,92 'swagger/openapi':26 'tag':58 'temporari':7 'typescript':2,11,29,36,88,90 'typescript-rest':35,89 'typescript-rest-swagg':10 'typescript-rest-swagger-plur':1 'use':55 'v0.0.40':14 'within':21","created_at":"2026-06-07T17:02:31.833357+00:00","updated_at":"2026-06-07T17:02:31.833357+00:00","problems":[{"fix":"Run 'npm install typescript-rest-swagger-plural' and change imports to 'typescript-rest-swagger-plural'.","cause":"Importing from the original package instead of the fork, or the package is not installed.","error":"Error: Cannot find module 'typescript-rest-swagger'"},{"fix":"Use an absolute path or ensure the path is relative to where the command is run.","cause":"The entryFile path in swaggerConfig.json does not exist or is relative to the wrong directory.","error":"swaggerGen: No such file or directory"},{"fix":"Ensure every exported controller class has @Path('something') and is properly imported in the entryFile.","cause":"A controller class is missing the @Path decorator or the file export is incorrect.","error":"TypeError: Cannot read property 'name' of undefined"},{"fix":"Check that entryFile exports all controllers and they are decorated with @Path.","cause":"No controller methods were found, possibly because the entryFile does not export any classes with @Path decorator.","error":"Warning: No operations defined in swagger!"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/thiagobustamante/typescript-rest-swagger#readme","github":"https://github.com/thiagobustamante/typescript-rest-swagger","docs":null,"changelog":null,"pypi":null,"npm":"typescript-rest-swagger-plural","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}