https://github.com/nomisrev/openapi-kt
Kotlin Multiplatform Typed OpenAPI Document Parser (KotlinX) with Typed Secondary Custom ADT for inspection, typed transformations, code generation, etc.
https://github.com/nomisrev/openapi-kt
Last synced: 11 months ago
JSON representation
Kotlin Multiplatform Typed OpenAPI Document Parser (KotlinX) with Typed Secondary Custom ADT for inspection, typed transformations, code generation, etc.
- Host: GitHub
- URL: https://github.com/nomisrev/openapi-kt
- Owner: nomisRev
- Created: 2024-04-10T20:43:21.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-07T09:20:43.000Z (about 1 year ago)
- Last Synced: 2025-05-07T10:28:20.597Z (about 1 year ago)
- Language: Kotlin
- Size: 1.1 MB
- Stars: 13
- Watchers: 4
- Forks: 2
- Open Issues: 23
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Module OpenAPI-kt
[](https://central.sonatype.com/search?q=g:io.github.nomisrev/openapi-kt-parser)
[](https://www.apache.org/licenses/LICENSE-2.0)
**WORK IN PROGRESS**
OpenKTTP is a toolset for working with OpenAPI in Kotlin.
This project exists out of several pieces, and they can be combined in different ways to achieve different goals.
- Core: A OpenAPI parser, and typed ADT based on KotlinX Serialization
- OpenAPI Typed: A version of the `Core` ADT, structures the data in a convenient way to retrieve.
- Generator: A code generator that generates code from the `OpenAPI Typed` ADT
- Gradle Plugin: Gradle plugin to conveniently generate clients
## Code Generation
Add the following to your `build.gradle.kts` file.
```kotlin
plugin {
id("io.github.nomisrev.openapi-kt-plugin") version "0.0.4"
}
openApiConfig {
spec("OpenAI", file("openai.yaml")) {
// packageName = "my.company.openai.generated"
}
}
```
Then run the following command to generate the code,
but it will also automatically run when you build your project.
```shell
./gradlew generateOpenApi
```
This will generate a `io.github.nomisrev.openapi` package with the generated code,
in your `/build/generated` directory.