Introduction
Generate OpenAPI V3 specifications from your AdonisJS application using TypeScript decorators with automatic type inference.
Build OpenAPI compliant APIs using AdonisJS.
import { } from '@foadonis/openapi/decorators'
export default class {
@()
declare : number
@()
declare : string
@({ : false, : })
declare ?: string
}import { , } from '@foadonis/openapi/decorators'
import from '#models/post'
export default class {
@({ : 'List all posts' })
@({ : [] })
() {
return .query()
}
@({ : 'Create a new Post' })
@({ : })
() {
return .create()
}
}Features
✔ OpenAPI V3 specifications
✔ Fully typesafe
✔ Automatically infer types
✔ Automatically loads your controller from Adonis Router
✔ Supports Scalar, Swagger UI and Rapidoc
✔ Supports schema generation from Luxon and VineJS