Basic
Basic Configuration
You can edit config/swagger.ts to customize your API documentation.
import { defineConfig } from "adonis-open-swagger";
/**
* Configuration for Open Swagger
*/
export default defineConfig({
/**
* Enable or disable swagger documentation
*/
enabled: true,
/**
* Path where the documentation will be served
*/
path: "/docs",
/**
* Schema validator to use for automatic schema conversion
* Choose based on your preferred validation library
*/
validator: "vinejs", // 'vinejs' | 'zod' | 'typebox'
/**
* OpenAPI specification information
*/
info: {
title: "VoiceOps",
version: "1.0.0",
description: "API documentation for VoiceOPS",
contact: {
name: "API Support",
email: "support@example.com",
},
license: {
name: "MIT",
url: "https://opensource.org/licenses/MIT",
},
},
/**
* Servers configuration
*/
servers: [
{
url: "http://localhost:3333",
description: "Development server",
},
],
});Options
enabled
Enable or disable swagger documentation.
path
Path where the documentation will be served. Example: /docs
validator
Schema validator to use for automatic schema conversion.
| name | description |
|---|---|
vinejs | Use VineJS for schema validation. VineJS Docs |
typebox | Use TypeBox for schema validation. TypeBox Docs |
zod | Use Zod for schema validation. Zod Docs |
info
OpenAPI specification information.
| name | description |
|---|---|
title | Title of the API |
version | Version of the API |
description | Description of the API |
contact | Contact information for the API |
license | License information for the API |
servers
Servers configuration.
| name | description |
|---|---|
url | URL of the server |
description | Description of the server |
Last updated on