C# Class NSwag.SwaggerDocument

Describes a JSON web service.
Inheritance: IDocumentPathProvider
Datei anzeigen Open project: NSwag/NSwag Class Usage Examples

Private Properties

Property Type Description
GetOperationNameFromPath string

Public Methods

Method Description
FromFile ( string filePath ) : SwaggerDocument

Creates a Swagger specification from a JSON file.

FromJson ( string data, string documentPath = null ) : SwaggerDocument

Creates a Swagger specification from a JSON string.

FromUrl ( string url ) : SwaggerDocument

Creates a Swagger specification from an URL.

GenerateOperationIds ( ) : void

Generates missing or non-unique operation IDs.

SwaggerDocument ( ) : System.Collections.Generic

Initializes a new instance of the SwaggerDocument class.

ToJson ( ) : string

Converts the description object to JSON.

ToJson ( NJsonSchema.JsonSchemaGeneratorSettings jsonSchemaGenerator ) : string

Converts the description object to JSON.

Private Methods

Method Description
GetOperationNameFromPath ( SwaggerOperationDescription operation ) : string

Method Details

FromFile() public static method

Creates a Swagger specification from a JSON file.
public static FromFile ( string filePath ) : SwaggerDocument
filePath string The file path.
return SwaggerDocument

FromJson() public static method

Creates a Swagger specification from a JSON string.
public static FromJson ( string data, string documentPath = null ) : SwaggerDocument
data string The JSON data.
documentPath string The document path (URL or file path) for resolving relative document references.
return SwaggerDocument

FromUrl() public static method

Creates a Swagger specification from an URL.
public static FromUrl ( string url ) : SwaggerDocument
url string The URL.
return SwaggerDocument

GenerateOperationIds() public method

Generates missing or non-unique operation IDs.
public GenerateOperationIds ( ) : void
return void

SwaggerDocument() public method

Initializes a new instance of the SwaggerDocument class.
public SwaggerDocument ( ) : System.Collections.Generic
return System.Collections.Generic

ToJson() public method

Converts the description object to JSON.
public ToJson ( ) : string
return string

ToJson() public method

Converts the description object to JSON.
public ToJson ( NJsonSchema.JsonSchemaGeneratorSettings jsonSchemaGenerator ) : string
jsonSchemaGenerator NJsonSchema.JsonSchemaGeneratorSettings The json schema generator.
return string