Class ClientGenerationOptions
- Namespace
- TypedRest.CodeGeneration.Generation
- Assembly
- TypedRest.CodeGeneration.dll
Options controlling the generation of a TypedRest client, common to all target languages.
public class ClientGenerationOptions
- Inheritance
-
objectClientGenerationOptions
- Derived
Remarks
Target languages derive from this to add their own options.
Constructors
ClientGenerationOptions(string)
Creates new generation options.
public ClientGenerationOptions(string serviceName)
Parameters
serviceNamestringThe service name to use for the entry endpoint.
ClientGenerationOptions(ClientGenerationOptions)
Copies the common options from other.
protected ClientGenerationOptions(ClientGenerationOptions other)
Parameters
otherClientGenerationOptions
Remarks
Used by target languages to accept options that were built without knowledge of the language.
Properties
DtoNamespace
The namespace or module path for the DTOs. Uses Namespace if not set.
public string? DtoNamespace { get; set; }
Property Value
GenerateDtos
Controls whether to generate DTOs.
public bool GenerateDtos { get; set; }
Property Value
GenerateEntryConstructor
Controls whether the entry endpoint gets a generated constructor taking the base URI. Turn this off to supply the constructors yourself, e.g. to pass an error handler or custom headers. Not supported by all target languages.
public bool GenerateEntryConstructor { get; set; }
Property Value
GenerateInterfaces
Controls whether to generate interfaces for endpoints. Not supported by all target languages.
public bool GenerateInterfaces { get; set; }
Property Value
Namespace
The namespace or module path for the endpoints. Uses ServiceName if not set.
public string? Namespace { get; set; }
Property Value
Serializer
The JSON serializer the generated DTOs are annotated for, or null to use the target language's default.
public string? Serializer { get; set; }
Property Value
Remarks
The serializer decides which attributes/annotations carry the wire names of properties, so choosing one that does not match the serializer configured on the endpoint at runtime silently changes the wire format. See SupportedSerializers for the values a target language accepts.
ServiceName
The service name to use for the entry endpoint.
public string ServiceName { get; }
Property Value
SupportedSerializers
The names accepted by Serializer, most preferred first. Empty if the target language has no serializer to choose, either because it does not annotate DTOs or because it only supports one.
public virtual IReadOnlyCollection<string> SupportedSerializers { get; }
Property Value
Remarks
Target languages override this to declare what they can generate for.