Table of Contents

Class DtoGenerator

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

Generates TypeScript types for the schemas in an OpenAPI/Swagger document.

public class DtoGenerator
Inheritance
object
DtoGenerator

Constructors

DtoGenerator(INamingStrategy, TypeNameRegistry?)

Generates TypeScript types for the schemas in an OpenAPI/Swagger document.

public DtoGenerator(INamingStrategy naming, TypeNameRegistry? typeNames = null)

Parameters

naming INamingStrategy

Decides what the generated types are called.

typeNames TypeNameRegistry

Keeps the generated names from colliding. Share this with an endpoint generator writing to the same output directory.

Methods

Generate(IEnumerable<KeyValuePair<string, OpenApiSchema>>)

Generates a type for each of the schemas that needs one.

public IEnumerable<ITsType> Generate(IEnumerable<KeyValuePair<string, OpenApiSchema>> schemas)

Parameters

schemas IEnumerable<KeyValuePair<string, OpenApiSchema>>

Returns

IEnumerable<ITsType>