Skip to main content

OpenAPI Specification Support

Supported Features

The generator supports the following OpenAPI 3.0/3.1 features:

FeatureSupport
Schema definitions (components/schemas)
Path definitions with HTTP methods
GET, POST, PUT, DELETE, PATCH
Parameters (path, query, header, cookie)
Request bodies
Responses with schema references
Arrays and nested objects
Enum values
Required/optional fields

Type Mapping

OpenAPI types are mapped to Kotlin types as follows:

OpenAPI TypeFormatKotlin Type
string-String
stringdate-timeString
stringuuidString
integerint32Int
integerint64Long
numberfloatFloat
numberdoubleDouble
boolean-Boolean
array-List<T>
object-Data class

Example OpenAPI Specification

openapi: 3.0.0
info:
title: Petstore API
version: 1.0.0
paths:
/pet/findByStatus:
get:
summary: Finds Pets by status
parameters:
- name: status
in: query
schema:
type: array
items:
type: string
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Pet'
components:
schemas:
Pet:
type: object
required:
- name
properties:
id:
type: integer
format: int64
name:
type: string
status:
type: string
enum: [available, pending, sold]

Limitations

  • Not all OpenAPI features are currently supported
  • Advanced authentication schemes require manual implementation
  • Complex oneOf, anyOf, allOf schemas have limited support

For unsupported features, you may need to manually adjust the generated code.