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
-
objectDtoInterfaceBuilder
- 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
keystringThe key identifying the schema.
schemaOpenApiSchemaThe schema to generate a type for.
namingINamingStrategyDecides what the generated type is called.
typeNamesTypeNameRegistryKeeps 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
RequiredProperties
The keys of the required properties, including any from inline allOf schemas.
protected readonly ICollection<string> RequiredProperties
Field Value
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
keystringschemaOpenApiSchema
Returns
BuildTypeInner()
Builds the type for Schema, without the parts common to all kinds of DTO.
protected override ITsType BuildTypeInner()