A KMP friendly OpenAPI parser, extension spec and Ktor-Client for Endpoint adaption and transformation at Runtime. https://code.mallne.cloud/Aviator
Find a file
2026-09-19 22:10:16 +02:00
.ai Add .ai/ documentation guides for multiple modules 2026-08-04 16:33:14 +02:00
.github/workflows fix: push bump commit to master via HEAD:master, stay on tag checkout 2026-09-19 21:05:36 +02:00
aviator-resource-server Add OpenTelemetry support and configure instrumentation 2026-09-11 10:38:57 +02:00
clients fix: restore findProperty for -PVERSION_NAME CI override to work 2026-09-19 20:21:50 +02:00
core fix: restore findProperty for -PVERSION_NAME CI override to work 2026-09-19 20:21:50 +02:00
gradle fix: proper gradle wrapper, conditional signing, updated workflows 2026-09-19 10:10:49 +02:00
koas fix: restore findProperty for -PVERSION_NAME CI override to work 2026-09-19 20:21:50 +02:00
plugins fix: restore findProperty for -PVERSION_NAME CI override to work 2026-09-19 20:21:50 +02:00
.dockerignore Update Metadata 2025-02-03 08:17:29 +01:00
.gitignore First functional prototype 2025-01-11 23:44:26 +01:00
AGENTS.md Add .ai/ documentation guides for multiple modules 2026-08-04 16:33:14 +02:00
build.gradle.kts Version Updates 2025-08-17 11:29:52 +02:00
gradle.properties fix: proper gradle wrapper, conditional signing, updated workflows 2026-09-19 10:10:49 +02:00
gradlew fix: proper gradle wrapper, conditional signing, updated workflows 2026-09-19 10:10:49 +02:00
gradlew.bat fix: proper gradle wrapper, conditional signing, updated workflows 2026-09-19 10:10:49 +02:00
LICENSE Update Metadata 2025-01-12 00:03:28 +01:00
README.md Add Readme and Agents Files 2026-03-19 21:40:13 +01:00
renovate.json fix: use regex allowedVersions to filter cloud.mallne to stable only 2026-09-19 22:10:16 +02:00
settings.gradle.kts fix: add Nexus repository for dependency resolution in standalone CI builds 2026-09-19 18:47:01 +02:00

Aviator ✈️

DiCentra Kotlin OpenAPI License Kotlin Multiplatform

Aviator is a modern, API-first application framework built with Kotlin Multiplatform. It empowers developers to build robust services and clients by treating the OpenAPI (OAS) specification as the single source of truth.


🚀 Overview

Aviator bridges the gap between API design and implementation. By extending the OpenAPI specification with custom x-dicentra-aviator-* attributes, the framework can automatically "materialize" declarative API operations into executable Kotlin service logic.

Why Aviator?

  • API-First: Design your API in OpenAPI and let Aviator handle the plumbing.
  • Multiplatform: Share service definitions and client logic across JVM, Android, and other KMP targets.
  • Type-Safe: Leverage Kotlin's powerful type system for your API models.
  • Extensible: A rich plugin system for authentication, interception, and content negotiation.

📦 Project Structure

The project is highly modular, allowing you to include only what you need:

Module Description
:core The heart of Aviator. Handles service conversion and plugin management.
:koas Kotlin-native models and utilities for OpenAPI 3.x specifications.
:clients Implementations for consuming Aviator services.
:plugins Extensions for various cross-cutting concerns.
:aviator-resource-server A reference Ktor server for testing and validation.

🔌 Plugins

Aviator uses a powerful plugin system to handle cross-cutting concerns. Plugins are activated during the service crystallization process.

Content Adapters

Enable support for different content types (JSON, XML) using Kotlin Serialization.

  • JsonAdapter: Provides JSON serialization support.
    plugins {
        install(JsonAdapter) {
            // Standard configuration
        }
    }
    
  • XmlAdapter: Provides XML serialization support.
    plugins {
        install(XmlAdapter) {
            // Standard configuration
        }
    }
    

Security & Middleware

  • HttpAuth: Adds support for HTTP authentication (e.g., Basic, Bearer).
    plugins {
        install(HttpAuth) {
            doBase64Encode = true
            serviceFilter = mutableListOf(ServiceLocator("my-secure-service"))
        }
    }
    
  • Interception: Allows for custom request/response interception via a staged pipeline.
    plugins {
        install(Interception) {
            steps {
                before { context -> 
                    println("Executing: ${context.serviceLocator}")
                }
            }
        }
    }
    

Advanced Integrations

  • Synapse: Facilitates communication between disparate service layers or external systems.
    plugins {
        install(Synapse) {
            active = true
        }
    }
    
  • Weaver: Integrates with the DiCentra Weaver engine for advanced data transformation and schema validation.
    plugins {
        install(Weaver) {
            weaver = myCustomWeaver
            schema = myWeaverSchema
        }
    }
    

🛰️ Clients

Aviator provides multiple client implementations to suit different environments and testing needs.

  • Ktor Client (:clients:ktor): The primary production-ready client. It uses the Ktor HTTP engine to perform real network requests based on the Aviator service definitions derived from OpenAPI. It supports full content negotiation and plugin execution.

  • Mock Client (:clients:mock): A specialized client for testing and local development. Instead of making network calls, it captures the execution context (headers, body, parameters) and allows you to simulate service responses, making it ideal for unit and integration tests.


🛠️ Getting Started

Prerequisites

  • JDK 17 or higher
  • Gradle

Building the Project

./gradlew build

Running the Test Server

To see Aviator in action, you can run the built-in resource server:

./gradlew :aviator-resource-server:run

🧩 Custom OpenAPI Extensions

Aviator uses custom extensions to map OpenAPI operations to Kotlin services:

  • x-dicentra-aviator: Specifies the version of the Aviator spec.
  • x-dicentra-aviator-serviceDelegateCall: Points to the Kotlin service implementation.
  • x-dicentra-aviator-serviceOptions: Provides configuration options for the service.
  • x-dicentra-aviator-pluginMaterialization: Configures plugins for specific routes.

📜 License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.


Built with ❤️ by Mallne under the DiCentra umbrella