C# Class NSwag.CodeGeneration.SwaggerGenerators.SwaggerGenerator

Provides services to for Swagger generators like the creation of parameters and handling of schemas.
显示文件 Open project: NSwag/NSwag

Public Methods

Method Description
CreateBodyParameter ( string name, ParameterInfo parameter ) : SwaggerParameter

Creates a primitive parameter for the given parameter information reflection object.

CreatePathParameter ( string parameterName, string parameterType ) : SwaggerParameter

Creates a path parameter for a given type.

CreatePrimitiveParameter ( string name, ParameterInfo parameter ) : SwaggerParameter

Creates a primitive parameter for the given parameter information reflection object.

CreatePrimitiveParameter ( string name, string description, Type parameterType, IList parentAttributes ) : SwaggerParameter

Creates a primitive parameter for the given parameter information reflection object.

GenerateAndAppendSchemaFromType ( Type type, bool mayBeNull, IEnumerable parentAttributes ) : NJsonSchema.JsonSchema4

Generates and appends a schema from a given type.

SwaggerGenerator ( JsonSchemaGenerator schemaGenerator, NJsonSchema.JsonSchemaGeneratorSettings schemaGeneratorSettings, JsonSchemaResolver schemaResolver ) : System

Initializes a new instance of the SwaggerGenerator class.

Private Methods

Method Description
IsFileResponse ( Type returnType ) : bool
IsParameterRequired ( ParameterInfo parameter ) : bool

Method Details

CreateBodyParameter() public method

Creates a primitive parameter for the given parameter information reflection object.
public CreateBodyParameter ( string name, ParameterInfo parameter ) : SwaggerParameter
name string The name.
parameter System.Reflection.ParameterInfo The parameter.
return SwaggerParameter

CreatePathParameter() public method

Creates a path parameter for a given type.
public CreatePathParameter ( string parameterName, string parameterType ) : SwaggerParameter
parameterName string Name of the parameter.
parameterType string Type of the parameter.
return SwaggerParameter

CreatePrimitiveParameter() public method

Creates a primitive parameter for the given parameter information reflection object.
public CreatePrimitiveParameter ( string name, ParameterInfo parameter ) : SwaggerParameter
name string The name.
parameter System.Reflection.ParameterInfo The parameter information.
return SwaggerParameter

CreatePrimitiveParameter() public method

Creates a primitive parameter for the given parameter information reflection object.
public CreatePrimitiveParameter ( string name, string description, Type parameterType, IList parentAttributes ) : SwaggerParameter
name string The name.
description string The description.
parameterType System.Type Type of the parameter.
parentAttributes IList The parent attributes.
return SwaggerParameter

GenerateAndAppendSchemaFromType() public method

Generates and appends a schema from a given type.
public GenerateAndAppendSchemaFromType ( Type type, bool mayBeNull, IEnumerable parentAttributes ) : NJsonSchema.JsonSchema4
type System.Type The type.
mayBeNull bool if set to true [may be null].
parentAttributes IEnumerable The parent attributes.
return NJsonSchema.JsonSchema4

SwaggerGenerator() public method

Initializes a new instance of the SwaggerGenerator class.
public SwaggerGenerator ( JsonSchemaGenerator schemaGenerator, NJsonSchema.JsonSchemaGeneratorSettings schemaGeneratorSettings, JsonSchemaResolver schemaResolver ) : System
schemaGenerator JsonSchemaGenerator The schema generator.
schemaGeneratorSettings NJsonSchema.JsonSchemaGeneratorSettings The schema generator settings.
schemaResolver JsonSchemaResolver The schema resolver.
return System