/tsed:tsed-openapifrom Ts.ED
Documents a Ts.ED v8 API with OpenAPI. Configures @tsed/swagger and @tsed/scalar, annotates operations/models with @tsed/schema decorators, splits controllers across documents, and exports the spec.
Ships in Ts.ED. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Ts.ED generates the OpenAPI document from the same @tsed/schema metadata that drives validation and serialization. Fix the metadata, never hand-edit the generated JSON.
Read the configuration reference for every swagger / scalar option and the decorator reference for operation and response patterns. Model decorators belong to the sibling skill tsed-models; routes and parameters to tsed-controllers.
npm install @tsed/swagger and/or npm install @tsed/scalar.Server.ts for its side effect. Without the import the module is not registered and neither the UI nor the JSON route exists.swagger and/or scalar as an array of documents.import "@tsed/platform-express";
import "@tsed/swagger";
import "@tsed/scalar";
import {Configuration} from "@tsed/di";
import * as rest from "./controllers/rest/index.js";
@Configuration({
mount: {"/rest": [...Object.values(rest)]},
swagger: [{path: "/doc", specVersion: "3.0.3"}],
scalar: [{path: "/scalar", specVersion: "3.1.0"}]
})
export class Server {}
mount takes controller classes only (imported one by one or through a barrel as above). Do not pass glob strings: they are silently dropped, so the server and the spec expose no route.
The UI is served on path; the JSON on <path>/<fileName> (swagger.json for Swagger, openapi.json for Scalar).
specVersion accepts "2.0", "3.0.1", "3.0.2", "3.0.3", "3.1.0". Always set it: when omitted (and spec.openapi is absent) Ts.ED emits Swagger 2.0.
Do not give two documents the same path: the generated spec is cached by path.
Put static metadata in spec and let controllers contribute paths and schemas.
swagger: [
{
path: "/doc",
specVersion: "3.0.3",
spec: {
info: {title: "Orders API", version: "1.2.0"},
components: {
securitySchemes: {bearer: {type: "http", scheme: "bearer", bearerFormat: "JWT"}}
}
},
operationIdPattern: "%c_%m",
sortPaths: true
}
];
info.version falls back to the root version configuration key.operationIdPattern (%c class name, %m method name) or operationIdFormatter: (name, propertyKey, path) => string. The default is camelCase of %c.%m; duplicates get a suffix.specPath to merge a base JSON file, and the $alterOpenSpec(spec, conf) hook on Server for last-mile edits.Import every decorator below from @tsed/schema.
import {Controller} from "@tsed/di";
import {NotFound} from "@tsed/exceptions";
import {PathParams} from "@tsed/platform-params";
import {Description, Get, Returns, Security, Summary, Tags} from "@tsed/schema";
import {Order} from "../models/Order.js";
@Controller("/orders")
@Tags("Orders")
export class OrdersController {
@Get("/:id")
@Summary("Get an order")
@Description("Returns one order by its identifier")
@Security("bearer")
@(Returns(200, Order).Description("The order").Groups("read"))
@(Returns(404, NotFound).Description("Order not found"))
get(@PathParams("id") id: string) {}
}
@Returns(status, Model) per status code. Wrap chained calls in parentheses: @(Returns(...).X()).@(Returns(200, Array).Of(Order)); a TypeScript Promise<Order[]> return type is not read.@Generics("T") on the model and .Of(Model) / .Nested(Model) on the response.@Deprecated(), @OperationId("name"), @Consumes(...), @Produces(...) or .ContentType(...) only when the default is wrong.@Example(value); on responses with .Examples({...}).@Security(name) must match a key of spec.components.securitySchemes (OS3) or spec.securityDefinitions (OS2).doc: "admin" on a document and @Docs("admin") on controllers. Import Docs from @tsed/swagger or @tsed/scalar.pathPatterns: ["/rest/admin/**"] (micromatch, negation with !). Patterns are tested against the controller's mounted route, not individual method paths.doc nor pathPatterns includes every non-hidden controller. A document with either one includes only matching controllers.@Hidden() on a controller or a method to remove it from every document.Pick one; details and a full script in the configuration reference.
outFile: "./spec/openapi.json" on a document: written at $onReady on every start.PlatformExpress.bootstrap(Server) (no listen()), resolves SwaggerService from @tsed/swagger and calls getOpenAPISpec(conf).@tsed/cli-generate-swagger (tsed run generate-swagger --output <dir>); see the sibling skill tsed-cli.getSpec(Controller) or generateSpec({tokens, ...}) from @tsed/schema for a DI-free unit test.Check in this order:
Server.ts and the configuration key is an array.mount (or imports); the spec is built from mounted controllers only.@Hidden() on the class or method.doc / pathPatterns filter matches the controller (step 4).@Returns(status, Model); without it the operation has no response schema.@Property(), @Required(), ...); undecorated properties are absent..Groups(...) on @Returns or @Groups on properties is not filtering the field out.disableSpec: true removes the JSON route; viewPath: false removes the UI.@tsed/common; use @tsed/schema, @tsed/di, @tsed/platform-params.swagger: {...} as an object; it must be an array.@Docs() to some controllers and expect the others to stay in a document that sets doc.paths in spec for routes Ts.ED already serves; decorate the controller.helmet is a CSP problem, not a spec problem. See https://tsed.dev/tutorials/swagger.md.hidden: true on a Swagger document only hides it from the UI dropdown; the route stays served.outFile is written after the server is ready, not at build time; a CI job needs option 2 or 3 of step 5.@Returns(Model) without a status documents 200. The second argument must be a class: write @(Returns(404).Description("Not found")), not @Returns(404, {description: "Not found"}).options; cdn overrides the default jsDelivr bundle URL.SwaggerService is an alias of OpenAPIService from @tsed/openapi-utils; @tsed/scalar does not re-export it.swagger / scalar is an array with unique path values.spec.info and security schemes are declared; every @Security name resolves.@Summary, and one @Returns per status code with a model..Of(); no response relies on the TypeScript return type.doc + @Docs, or pathPatterns) were checked against the served JSON.Further reading: https://tsed.dev/tutorials/swagger.md, https://tsed.dev/tutorials/scalar.md, https://tsed.dev/docs/controllers.md, https://tsed.dev/docs/model.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
13 skills in this plugin
/tsed-cliScaffolds Ts.ED v8 projects and generates files with the Ts.ED CLI v7, through its MCP server (tools set-workspace, init-project, list-templates, get-template, generate-file) or the tsed binary (tsed init, generate, template, add, run, update, dev, build). Use when creating a Ts.ED project, adding a controller, service, middleware, model, interceptor, pipe, decorator or custom template, when package.json has a "tsed" key or @tsed/cli, when a .templates/ directory exists, or on errors E_CWD_NOT_SET, E_PROJECT_NOT_INITIALIZED, E_TEMPLATE_UNKNOWN, E_ARGS_INVALID./tsed-configurationConfigure and bootstrap a Ts.ED v8 server - the @Configuration decorator or configuration() on the Server class, PlatformExpress/PlatformKoa/PlatformFastify.bootstrap, server options (mount, middlewares, httpPort, httpsPort, acceptMimes, logger, statics, views, responseFilters, imports), per-platform express/koa/fastify options, and @tsed/config sources (envs, dotenv, json, yaml). Use when editing Server.ts, index.ts or src/config, adding @tsed/config or the extends option, or reading settings with constant(), refValue(), @Constant, @Value or configuration().get()./tsed-controllersWrite Ts.ED v8 HTTP controllers and routes - @Controller paths and nested children, mounting through the `mount` configuration, verb decorators from @tsed/schema, parameter decorators from @tsed/platform-params, typed inputs, response decorators and custom endpoint decorators. Use when adding or fixing a REST endpoint, when a route returns 404 or is shadowed by another route, when @BodyParams/@QueryParams/@PathParams receive a plain object or the wrong type, or when working with @Returns, @Status, @Redirect, @View, @Hidden, @Req/@Res or useDecorators.npx claudepluginhub tsedio/tsed --plugin tsedOther plugins' skills for the same job