Class OpenApiDocumentExtensions
- Namespace
- TypedRest.CodeGeneration.Kotlin
- Assembly
- TypedRest.CodeGeneration.Kotlin.dll
Generates Kotlin TypedRest clients for OpenAPI/Swagger documents.
public static class OpenApiDocumentExtensions
- Inheritance
-
objectOpenApiDocumentExtensions
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
docOpenApiDocumentnamingINamingStrategytypeNamesTypeNameRegistry
Returns
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
docOpenApiDocumentThe document describing the service.
optionsKotlinGenerationOptionsOptions controlling the generation.
logIGenerationLogCollects messages about aspects of the document that Kotlin cannot express.
patternsPatternRegistryControls what is inferred when the document has no
x-typedrestextension.buildersBuilderRegistryControls what code is emitted for each kind of endpoint.
Returns
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
docOpenApiDocumentnamingINamingStrategywithInterfacesboollogIGenerationLogpatternsPatternRegistrybuildersBuilderRegistrytypeNamesTypeNameRegistry