Table of Contents

Class DtoInterfaceBuilder

Namespace
TypedRest.CodeGeneration.TypeScript.Dtos
Assembly
TypedRest.CodeGeneration.TypeScript.dll

Builds a TypeScript interface for an object schema.

public class DtoInterfaceBuilder : DtoBuilder
Inheritance
object
DtoInterfaceBuilder
Inherited Members

Constructors

DtoInterfaceBuilder(string, OpenApiSchema, INamingStrategy, TypeNameRegistry?)

Builds a TypeScript interface for an object schema.

public DtoInterfaceBuilder(string key, OpenApiSchema schema, INamingStrategy naming, TypeNameRegistry? typeNames = null)

Parameters

key string

The key identifying the schema.

schema OpenApiSchema

The schema to generate a type for.

naming INamingStrategy

Decides what the generated type is called.

typeNames TypeNameRegistry

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

Fields

Properties

The properties of this type, including any merged in from inline allOf schemas.

protected readonly IReadOnlyDictionary<string, OpenApiSchema> Properties

Field Value

IReadOnlyDictionary<string, OpenApiSchema>

RequiredProperties

The keys of the required properties, including any from inline allOf schemas.

protected readonly ICollection<string> RequiredProperties

Field Value

ICollection<string>

Methods

BuildProperty(string, OpenApiSchema?)

Builds a property, keeping the exact key used on the wire as its name.

protected virtual TsProperty BuildProperty(string key, OpenApiSchema? schema)

Parameters

key string
schema OpenApiSchema

Returns

TsProperty

BuildTypeInner()

Builds the type for Schema, without the parts common to all kinds of DTO.

protected override ITsType BuildTypeInner()

Returns

ITsType