🎯
Single Source of Truth
Define types once in TypeScript, reference them in JSDoc. No duplication, no drift between code and documentation.
Generate OpenAPI documentation from JSDoc comments and TypeScript types. Keep your API docs in sync with your code automatically.
import type { User, CreateUserRequest, ErrorResponse } from '@/types/user'
/**
* @autoswag POST /users
* @summary Create a new user
* @tag Users
* @accept {CreateUserRequest}
* @response {User} 201 User created successfully
* @response {ErrorResponse} 400 Invalid input
* @response 401 Unauthorized
*/
export async function createUser(req, res) {
// Your implementation here
}