C# Class NSwag.CodeGeneration.CodeGenerators.TypeScript.SwaggerToTypeScriptClientGenerator

Generates the CSharp service client code.
Inheritance: ClientGeneratorBase
Mostrar archivo Open project: NSwag/NSwag Class Usage Examples

Private Properties

Property Type Description
AppendExtensionClassIfNecessary string
GenerateClientClass string
GenerateFile string
GetClassName string
GetExceptionType string
GetResultType string
GetType string
UpdateUseDtoClassAndDataConversionCodeProperties void

Public Methods

Method Description
GenerateFile ( ) : string

Generates the file.

SwaggerToTypeScriptClientGenerator ( SwaggerDocument document, SwaggerToTypeScriptClientGeneratorSettings settings ) : System

Initializes a new instance of the SwaggerToTypeScriptClientGenerator class.

SwaggerToTypeScriptClientGenerator ( SwaggerDocument document, SwaggerToTypeScriptClientGeneratorSettings settings, TypeScriptTypeResolver resolver ) : System

Initializes a new instance of the SwaggerToTypeScriptClientGenerator class.

Protected Methods

Method Description
ResolveParameterType ( SwaggerParameter parameter ) : string

Resolves the type of the parameter.

Private Methods

Method Description
AppendExtensionClassIfNecessary ( string controllerName, string code ) : string
GenerateClientClass ( string controllerName, string controllerClassName, IList operations, ClientGeneratorOutputType outputType ) : string
GenerateFile ( string clientCode, IEnumerable clientClasses, ClientGeneratorOutputType outputType ) : string
GetClassName ( string className ) : string
GetExceptionType ( SwaggerOperation operation ) : string
GetResultType ( SwaggerOperation operation ) : string
GetType ( NJsonSchema.JsonSchema4 schema, bool isNullable, string typeNameHint ) : string
UpdateUseDtoClassAndDataConversionCodeProperties ( IEnumerable operations ) : void

Method Details

GenerateFile() public method

Generates the file.
public GenerateFile ( ) : string
return string

ResolveParameterType() protected method

Resolves the type of the parameter.
protected ResolveParameterType ( SwaggerParameter parameter ) : string
parameter SwaggerParameter The parameter.
return string

SwaggerToTypeScriptClientGenerator() public method

Initializes a new instance of the SwaggerToTypeScriptClientGenerator class.
is .
public SwaggerToTypeScriptClientGenerator ( SwaggerDocument document, SwaggerToTypeScriptClientGeneratorSettings settings ) : System
document SwaggerDocument The Swagger document.
settings SwaggerToTypeScriptClientGeneratorSettings The settings.
return System

SwaggerToTypeScriptClientGenerator() public method

Initializes a new instance of the SwaggerToTypeScriptClientGenerator class.
is .
public SwaggerToTypeScriptClientGenerator ( SwaggerDocument document, SwaggerToTypeScriptClientGeneratorSettings settings, TypeScriptTypeResolver resolver ) : System
document SwaggerDocument The Swagger document.
settings SwaggerToTypeScriptClientGeneratorSettings The settings.
resolver TypeScriptTypeResolver The resolver.
return System