C# Class NSwag.SwaggerDocument

Describes a JSON web service.
Inheritance: IDocumentPathProvider
Afficher le fichier Open project: NSwag/NSwag Class Usage Examples

Private Properties

Свойство Type Description
GetOperationNameFromPath string

Méthodes publiques

Méthode 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

Méthode Description
GetOperationNameFromPath ( SwaggerOperationDescription operation ) : string

Method Details

FromFile() public static méthode

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

FromJson() public static méthode

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.
Résultat SwaggerDocument

FromUrl() public static méthode

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

GenerateOperationIds() public méthode

Generates missing or non-unique operation IDs.
public GenerateOperationIds ( ) : void
Résultat void

SwaggerDocument() public méthode

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

ToJson() public méthode

Converts the description object to JSON.
public ToJson ( ) : string
Résultat string

ToJson() public méthode

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