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
-
objectDtoBuilder
- 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
keystringThe key of the schema in the document.
schemaOpenApiSchemaThe schema to build a type for.
namingINamingStrategyDecides what the generated type is called.
typeNamesTypeNameRegistryKeeps the generated names from colliding.
Fields
ChildTypes
Types generated for schemas inlined into this one.
protected readonly List<IJvmType> ChildTypes
Field Value
Identifier
The name and package of the generated type.
protected readonly JvmIdentifier Identifier
Field Value
Naming
Decides what the generated types are called.
protected readonly INamingStrategy Naming
Field Value
Schema
The schema being generated for.
protected readonly OpenApiSchema Schema
Field Value
TypeNames
Keeps the names of types generated for inline schemas from colliding with other generated types.
protected readonly TypeNameRegistry? TypeNames
Field Value
Methods
BuildTypeInner()
Builds the type itself, without the parts every kind of DTO has in common.
protected abstract IJvmType BuildTypeInner()
Returns
BuildTypes()
Builds the type for the schema, followed by any types generated for schemas inlined into it.
public IEnumerable<IJvmType> BuildTypes()
Returns
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
keystringschemaOpenApiSchemanamingINamingStrategytypeNamesTypeNameRegistry