Yes, you can use Deepkit for API documentation generation. Deepkit provides a built-in OpenAPI (formerly known as Swagger) module that automatically generates API documentation based on your defined routes and their types.
To enable the OpenAPI module, you can import the OpenApiModule
from @deepkit/openapi
and include it in your application's modules.
Here's an example:
import { App } from '@deepkit/app'; import { OpenApiModule } from '@deepkit/openapi'; const app = new App({ imports: [new OpenApiModule()], // other configuration }); app.run();
With the OpenAPI module enabled, you can access the generated documentation by visiting the /openapi
endpoint of your application. This endpoint provides the OpenAPI specification in JSON format, which can be used by external tools for API documentation or integration with other systems.
Additionally, you can customize the generated documentation by using OpenAPI decorators and annotations on your routes and controller classes. This allows you to provide additional information, such as API descriptions and parameter details, directly in your code.