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
-
objectDtoGenerator
Constructors
DtoGenerator(INamingStrategy, TypeNameRegistry?)
Generates TypeScript types for the schemas in an OpenAPI/Swagger document.
public DtoGenerator(INamingStrategy naming, TypeNameRegistry? typeNames = null)
Parameters
namingINamingStrategyDecides what the generated types are called.
typeNamesTypeNameRegistryKeeps 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
schemasIEnumerable<KeyValuePair<string, OpenApiSchema>>