Table of Contents

Class DtoBuilder

Namespace
TypedRest.CodeGeneration.Jvm.Dtos
Assembly
TypedRest.CodeGeneration.Jvm.dll

Builds the type for one schema in an OpenAPI/Swagger document.

public abstract class DtoBuilder
Inheritance
object
DtoBuilder
Derived

Constructors

DtoBuilder(string, OpenApiSchema, INamingStrategy, TypeNameRegistry?)

Builds the type for one schema in an OpenAPI/Swagger document.

protected DtoBuilder(string key, OpenApiSchema schema, INamingStrategy naming, TypeNameRegistry? typeNames = null)

Parameters

key string

The key of the schema in the document.

schema OpenApiSchema

The schema to build a type for.

naming INamingStrategy

Decides what the generated type is called.

typeNames TypeNameRegistry

Keeps the generated names from colliding.

Fields

ChildTypes

Types generated for schemas inlined into this one.

protected readonly List<IJvmType> ChildTypes

Field Value

List<IJvmType>

Identifier

The name and package of the generated type.

protected readonly JvmIdentifier Identifier

Field Value

JvmIdentifier

Naming

Decides what the generated types are called.

protected readonly INamingStrategy Naming

Field Value

INamingStrategy

Schema

The schema being generated for.

protected readonly OpenApiSchema Schema

Field Value

OpenApiSchema

TypeNames

Keeps the names of types generated for inline schemas from colliding with other generated types.

protected readonly TypeNameRegistry? TypeNames

Field Value

TypeNameRegistry

Methods

BuildTypeInner()

Builds the type itself, without the parts every kind of DTO has in common.

protected abstract IJvmType BuildTypeInner()

Returns

IJvmType

BuildTypes()

Builds the type for the schema, followed by any types generated for schemas inlined into it.

public IEnumerable<IJvmType> BuildTypes()

Returns

IEnumerable<IJvmType>

For(string, OpenApiSchema, INamingStrategy, TypeNameRegistry?)

Returns the builder for schema, or null if it needs no type of its own.

public static DtoBuilder? For(string key, OpenApiSchema schema, INamingStrategy naming, TypeNameRegistry? typeNames = null)

Parameters

key string
schema OpenApiSchema
naming INamingStrategy
typeNames TypeNameRegistry

Returns

DtoBuilder