@@ -24,6 +24,10 @@ public static class OpenApiModelFactory
2424 /// <param name="settings"> The OpenApi reader settings.</param>
2525 /// <param name="format">The OpenAPI format.</param>
2626 /// <returns>An OpenAPI document instance.</returns>
27+ /// <remarks>
28+ /// OpenAPI semantic errors are returned in the <see cref="ReadResult.Diagnostic"/>. Syntax-level JSON or YAML
29+ /// errors can throw before a <see cref="ReadResult"/> is created.
30+ /// </remarks>
2731 public static ReadResult Load ( MemoryStream stream ,
2832 string ? format = null ,
2933 OpenApiReaderSettings ? settings = null )
@@ -59,6 +63,10 @@ public static ReadResult Load(MemoryStream stream,
5963 /// <param name="settings">The OpenApiReader settings.</param>
6064 /// <returns>Instance of newly created IOpenApiElement.</returns>
6165 /// <returns>The OpenAPI element.</returns>
66+ /// <remarks>
67+ /// OpenAPI semantic errors are returned in the <paramref name="diagnostic"/>. Syntax-level JSON or YAML
68+ /// errors can throw before a fragment is created.
69+ /// </remarks>
6270 public static T ? Load < T > ( MemoryStream input , OpenApiSpecVersion version , string ? format , OpenApiDocument openApiDocument , out OpenApiDiagnostic diagnostic , OpenApiReaderSettings ? settings = null ) where T : IOpenApiElement
6371 {
6472 format ??= InspectStreamFormat ( input ) ;
@@ -73,6 +81,10 @@ public static ReadResult Load(MemoryStream stream,
7381 /// <param name="settings"> The OpenApi reader settings.</param>
7482 /// <param name="token">The cancellation token</param>
7583 /// <returns></returns>
84+ /// <remarks>
85+ /// OpenAPI semantic errors are returned in the <see cref="ReadResult.Diagnostic"/>. Syntax-level JSON or YAML
86+ /// errors can throw before a <see cref="ReadResult"/> is created.
87+ /// </remarks>
7688 public static async Task < ReadResult > LoadAsync ( string url , OpenApiReaderSettings ? settings = null , CancellationToken token = default )
7789 {
7890 settings ??= DefaultReaderSettings . Value ;
@@ -94,6 +106,10 @@ public static async Task<ReadResult> LoadAsync(string url, OpenApiReaderSettings
94106 /// <param name="token"></param>
95107 /// <returns>Instance of newly created IOpenApiElement.</returns>
96108 /// <returns>The OpenAPI element.</returns>
109+ /// <remarks>
110+ /// OpenAPI semantic errors are returned by the reader diagnostic. Syntax-level JSON or YAML errors can throw
111+ /// before a fragment is created.
112+ /// </remarks>
97113 public static async Task < T ? > LoadAsync < T > ( string url , OpenApiSpecVersion version , OpenApiDocument openApiDocument , OpenApiReaderSettings ? settings = null , CancellationToken token = default ) where T : IOpenApiElement
98114 {
99115 settings ??= DefaultReaderSettings . Value ;
@@ -112,6 +128,10 @@ public static async Task<ReadResult> LoadAsync(string url, OpenApiReaderSettings
112128 /// <param name="cancellationToken">Propagates notification that operations should be cancelled.</param>
113129 /// <param name="format">The Open API format</param>
114130 /// <returns></returns>
131+ /// <remarks>
132+ /// OpenAPI semantic errors are returned in the <see cref="ReadResult.Diagnostic"/>. Syntax-level JSON or YAML
133+ /// errors can throw before a <see cref="ReadResult"/> is created.
134+ /// </remarks>
115135 public static async Task < ReadResult > LoadAsync ( Stream input , string ? format = null , OpenApiReaderSettings ? settings = null , CancellationToken cancellationToken = default )
116136 {
117137#if NET6_0_OR_GREATER
@@ -159,6 +179,10 @@ public static async Task<ReadResult> LoadAsync(Stream input, string? format = nu
159179 /// <param name="settings"></param>
160180 /// <param name="token"></param>
161181 /// <returns></returns>
182+ /// <remarks>
183+ /// OpenAPI semantic errors are returned by the reader diagnostic. Syntax-level JSON or YAML errors can throw
184+ /// before a fragment is created.
185+ /// </remarks>
162186 public static async Task < T ? > LoadAsync < T > ( Stream input ,
163187 OpenApiSpecVersion version ,
164188 OpenApiDocument openApiDocument ,
@@ -192,6 +216,10 @@ public static async Task<ReadResult> LoadAsync(Stream input, string? format = nu
192216 /// <param name="format">The Open API format</param>
193217 /// <param name="settings">The OpenApi reader settings.</param>
194218 /// <returns>An OpenAPI document instance.</returns>
219+ /// <remarks>
220+ /// OpenAPI semantic errors are returned in the <see cref="ReadResult.Diagnostic"/>. Syntax-level JSON or YAML
221+ /// errors can throw before a <see cref="ReadResult"/> is created.
222+ /// </remarks>
195223 public static ReadResult Parse ( string input ,
196224 string ? format = null ,
197225 OpenApiReaderSettings ? settings = null )
@@ -220,6 +248,10 @@ public static ReadResult Parse(string input,
220248 /// <param name="format">The Open API format</param>
221249 /// <param name="settings">The OpenApi reader settings.</param>
222250 /// <returns>An OpenAPI document instance.</returns>
251+ /// <remarks>
252+ /// OpenAPI semantic errors are returned in the <paramref name="diagnostic"/>. Syntax-level JSON or YAML
253+ /// errors can throw before a fragment is created.
254+ /// </remarks>
223255 public static T ? Parse < T > ( string input ,
224256 OpenApiSpecVersion version ,
225257 OpenApiDocument openApiDocument ,
@@ -437,7 +469,7 @@ private static async Task<MemoryStream> CopyToMemoryStreamAsync(Stream input, Ca
437469#endif
438470 bufferStream . Position = 0 ;
439471 return bufferStream ;
440- }
472+ }
441473
442474 private static async Task < ( Stream , string ) > PrepareStreamForReadingAsync ( Stream input , string ? format , CancellationToken token = default )
443475 {
0 commit comments