Skip to content

Kotlin Multiplatform Typed OpenAPI Document Parser (KotlinX) with Typed Secondary Custom ADT for inspection, typed transformations, code generation, etc.

Notifications You must be signed in to change notification settings

nomisRev/OpenAPI-kt

Repository files navigation

Module OpenAPI-kt

Maven Central License

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.

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.

./gradlew generateOpenApi

This will generate a io.github.nomisrev.openapi package with the generated code, in your /build/generated directory.

About

Kotlin Multiplatform Typed OpenAPI Document Parser (KotlinX) with Typed Secondary Custom ADT for inspection, typed transformations, code generation, etc.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages