Table of Contents

Class OpenApiDocumentExtensions

Namespace
TypedRest.CodeGeneration.Kotlin
Assembly
TypedRest.CodeGeneration.Kotlin.dll

Generates Kotlin TypedRest clients for OpenAPI/Swagger documents.

public static class OpenApiDocumentExtensions
Inheritance
object
OpenApiDocumentExtensions

Methods

GenerateKotlinDtos(OpenApiDocument, INamingStrategy, TypeNameRegistry?)

Generates Kotlin types for the schemas in doc.

public static IEnumerable<IJvmType> GenerateKotlinDtos(this OpenApiDocument doc, INamingStrategy naming, TypeNameRegistry? typeNames = null)

Parameters

doc OpenApiDocument
naming INamingStrategy
typeNames TypeNameRegistry

Returns

IEnumerable<IJvmType>

GenerateTypedRestKotlin(OpenApiDocument, KotlinGenerationOptions, IGenerationLog?, PatternRegistry?, BuilderRegistry?)

Generates the source files of a Kotlin TypedRest client for doc.

public static IEnumerable<IGeneratedFile> GenerateTypedRestKotlin(this OpenApiDocument doc, KotlinGenerationOptions options, IGenerationLog? log = null, PatternRegistry? patterns = null, BuilderRegistry? builders = null)

Parameters

doc OpenApiDocument

The document describing the service.

options KotlinGenerationOptions

Options controlling the generation.

log IGenerationLog

Collects messages about aspects of the document that Kotlin cannot express.

patterns PatternRegistry

Controls what is inferred when the document has no x-typedrest extension.

builders BuilderRegistry

Controls what code is emitted for each kind of endpoint.

Returns

IEnumerable<IGeneratedFile>

GenerateTypedRestKotlinEndpoints(OpenApiDocument, INamingStrategy, bool, IGenerationLog?, PatternRegistry?, BuilderRegistry?, TypeNameRegistry?)

Generates the endpoint types of a Kotlin TypedRest client for doc, without the DTOs.

public static IEnumerable<IJvmType> GenerateTypedRestKotlinEndpoints(this OpenApiDocument doc, INamingStrategy naming, bool withInterfaces = false, IGenerationLog? log = null, PatternRegistry? patterns = null, BuilderRegistry? builders = null, TypeNameRegistry? typeNames = null)

Parameters

doc OpenApiDocument
naming INamingStrategy
withInterfaces bool
log IGenerationLog
patterns PatternRegistry
builders BuilderRegistry
typeNames TypeNameRegistry

Returns

IEnumerable<IJvmType>