Skip to content

AutoswagOpenAPI from TypeScript

Generate OpenAPI documentation from JSDoc comments and TypeScript types. Keep your API docs in sync with your code automatically.

Usage example

ts
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
}

Released under the MIT License.