OpenApiModelFactory.Load Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| Load(MemoryStream, String, OpenApiReaderSettings) |
Loads the input stream and parses it into an Open API document. |
| Load<T>(MemoryStream, OpenApiSpecVersion, String, OpenApiDocument, OpenApiDiagnostic, OpenApiReaderSettings) |
Reads the stream input and parses the fragment of an OpenAPI description into an Open API Element. |
Load(MemoryStream, String, OpenApiReaderSettings)
- Source:
- OpenApiModelFactory.cs
Loads the input stream and parses it into an Open API document.
public static Microsoft.OpenApi.Reader.ReadResult Load(System.IO.MemoryStream stream, string? format = default, Microsoft.OpenApi.Reader.OpenApiReaderSettings? settings = default);
static member Load : System.IO.MemoryStream * string * Microsoft.OpenApi.Reader.OpenApiReaderSettings -> Microsoft.OpenApi.Reader.ReadResult
Public Shared Function Load (stream As MemoryStream, Optional format As String = Nothing, Optional settings As OpenApiReaderSettings = Nothing) As ReadResult
Parameters
- stream
- MemoryStream
The input stream.
- format
- String
The OpenAPI format.
- settings
- OpenApiReaderSettings
The OpenApi reader settings.
Returns
An OpenAPI document instance.
Applies to
Load<T>(MemoryStream, OpenApiSpecVersion, String, OpenApiDocument, OpenApiDiagnostic, OpenApiReaderSettings)
- Source:
- OpenApiModelFactory.cs
Reads the stream input and parses the fragment of an OpenAPI description into an Open API Element.
public static T? Load<T>(System.IO.MemoryStream input, Microsoft.OpenApi.OpenApiSpecVersion version, string? format, Microsoft.OpenApi.OpenApiDocument openApiDocument, out Microsoft.OpenApi.Reader.OpenApiDiagnostic diagnostic, Microsoft.OpenApi.Reader.OpenApiReaderSettings? settings = default) where T : Microsoft.OpenApi.IOpenApiElement;
static member Load : System.IO.MemoryStream * Microsoft.OpenApi.OpenApiSpecVersion * string * Microsoft.OpenApi.OpenApiDocument * OpenApiDiagnostic * Microsoft.OpenApi.Reader.OpenApiReaderSettings -> 'T (requires 'T :> Microsoft.OpenApi.IOpenApiElement)
Public Shared Function Load(Of T As IOpenApiElement) (input As MemoryStream, version As OpenApiSpecVersion, format As String, openApiDocument As OpenApiDocument, ByRef diagnostic As OpenApiDiagnostic, Optional settings As OpenApiReaderSettings = Nothing) As T
Type Parameters
- T
Parameters
- input
- MemoryStream
Stream containing OpenAPI description to parse.
- version
- OpenApiSpecVersion
Version of the OpenAPI specification that the fragment conforms to.
- format
- String
- openApiDocument
- OpenApiDocument
The OpenApiDocument object to which the fragment belongs, used to lookup references.
- diagnostic
- OpenApiDiagnostic
Returns diagnostic object containing errors detected during parsing.
- settings
- OpenApiReaderSettings
The OpenApiReader settings.
Returns
Instance of newly created IOpenApiElement.