Class OpenApiDocumentFactory
Creates an NSwag.OpenApiDocument from a specified path or URL.
public static class OpenApiDocumentFactory
- Inheritance
-
OpenApiDocumentFactory
- Inherited Members
Methods
CreateAsync(IEnumerable<string>)
Creates a merged NSwag.OpenApiDocument from multiple paths or URLs. The first document serves as the base; paths and schemas from subsequent documents are merged in.
public static Task<OpenApiDocument> CreateAsync(IEnumerable<string> openApiPaths)
Parameters
openApiPathsIEnumerable<string>The paths or URLs to the OpenAPI specifications.
Returns
- Task<OpenApiDocument>
A merged NSwag.OpenApiDocument.
Exceptions
- ArgumentException
Thrown when
openApiPathsis null or empty.
CreateAsync(string)
Creates a new instance of the NSwag.OpenApiDocument class asynchronously.
public static Task<OpenApiDocument> CreateAsync(string openApiPath)
Parameters
openApiPathstringThe path or URL to the OpenAPI specification.
Returns
- Task<OpenApiDocument>
A new instance of the NSwag.OpenApiDocument class.