Getting Started¶
Welcome to InspeKtor! This section will help you get up and running with automatic OpenAPI specification generation for your Ktor server.
Overview¶
InspeKtor is designed to be as simple as possible to integrate:
- Add the plugin to your
build.gradle.kts - Annotate your routes with
@GenerateOpenApi - Build your project - that's it!
Prerequisites¶
Before you begin, make sure you have:
- Kotlin 2.0 or higher (see Compatibility for version mapping)
- Gradle 7.0 or higher
- A Ktor server project
What's Next?¶
Step-by-step guide to adding InspeKtor to your project
Generate your first OpenAPI spec in under 5 minutes
Explore a complete working example
How It Works¶
InspeKtor operates as a Kotlin compiler plugin, which means:
graph LR
A[Your Ktor Code] --> B[Kotlin Compiler]
B --> C[InspeKtor Plugin]
C --> D[OpenAPI Spec]
B --> E[Compiled Classes] - You write your Ktor routes as usual
- You annotate entry points with
@GenerateOpenApi - During compilation, InspeKtor analyzes your code
- An
openapi.yamloropenapi.jsonfile is generated
Key benefits of this approach:
- No runtime overhead - Generation happens at build time only
- No third party DSL - Use standard Ktor routing syntax
- Always accurate - The spec is derived directly from your source code