Table of Contents

Class OpenApiDocumentGeneratorSettings

Namespace
NSwag.Generation
Assembly
NSwag.Generation.dll

Settings for the Swagger generator.

public class OpenApiDocumentGeneratorSettings
Inheritance
OpenApiDocumentGeneratorSettings
Inherited Members

Constructors

OpenApiDocumentGeneratorSettings()

Initializes a new instance of the OpenApiDocumentGeneratorSettings class.

public OpenApiDocumentGeneratorSettings()

Properties

AllowNullableBodyParameters

Gets or sets a value indicating whether nullable body parameters are allowed (ignored when MvcOptions.AllowEmptyInputInBodyModelBinding is available (ASP.NET Core 2.0+), default: true).

public bool AllowNullableBodyParameters { get; set; }

Property Value

bool

DefaultResponseReferenceTypeNullHandling

Gets or sets the default response reference type null handling when no nullability information is available (if NotNullAttribute and CanBeNullAttribute are missing, default: NotNull).

public ReferenceTypeNullHandling DefaultResponseReferenceTypeNullHandling { get; set; }

Property Value

ReferenceTypeNullHandling

Description

Gets or sets the Swagger specification description.

public string Description { get; set; }

Property Value

string

DocumentProcessors

Gets the document processors.

public DocumentProcessorCollection DocumentProcessors { get; }

Property Value

DocumentProcessorCollection

DocumentTemplate

Gets or sets the document template representing the initial Swagger specification (JSON data).

public string DocumentTemplate { get; set; }

Property Value

string

GenerateOriginalParameterNames

Gets or sets a value indicating whether to generate x-originalName properties when parameter name is different in .NET and HTTP (default: true).

public bool GenerateOriginalParameterNames { get; set; }

Property Value

bool

OperationProcessors

Gets the operation processors.

public OperationProcessorCollection OperationProcessors { get; }

Property Value

OperationProcessorCollection

SchemaGeneratorFactory

Gets or sets the JSON Schema generator factory (default: new instance of OpenApiSchemaGenerator.

public Func<OpenApiSchemaGenerator> SchemaGeneratorFactory { get; set; }

Property Value

Func<OpenApiSchemaGenerator>

SchemaSettings

public JsonSchemaGeneratorSettings SchemaSettings { get; set; }

Property Value

JsonSchemaGeneratorSettings

Title

Gets or sets the Swagger specification title.

public string Title { get; set; }

Property Value

string

UseControllerSummaryAsTagDescription

Gets or sets a value indicating whether controllers' XML documentation will be used as tag descriptions (but only when the controller name is used as a tag, default: false).

public bool UseControllerSummaryAsTagDescription { get; set; }

Property Value

bool

UseHttpAttributeNameAsOperationId

Gets or sets a value indicating whether the HttpMethodAttribute Name property shall be used as OperationId.

public bool UseHttpAttributeNameAsOperationId { get; set; }

Property Value

bool

Version

Gets or sets the Swagger specification version.

public string Version { get; set; }

Property Value

string

Methods

AddOperationFilter(Func<OperationProcessorContext, bool>)

Inserts a function based operation processor at the beginning of the pipeline to be used to filter operations.

public void AddOperationFilter(Func<OperationProcessorContext, bool> filter)

Parameters

filter Func<OperationProcessorContext, bool>

The processor filter.

ApplySettings(JsonSchemaGeneratorSettings, object)

Applies the given settings to this settings object.

public void ApplySettings(JsonSchemaGeneratorSettings schemaSettings, object mvcOptions)

Parameters

schemaSettings JsonSchemaGeneratorSettings

The schema generator settings.

mvcOptions object

The MVC options.