@@ -25,9 +25,11 @@ public class OpenApiJsonReader : IOpenApiReader
2525 /// Reads the memory stream input and parses it into an Open API document.
2626 /// </summary>
2727 /// <param name="input">Memory stream containing OpenAPI description to parse.</param>
28+ /// <param name="location">Location of where the document that is getting loaded is saved</param>
2829 /// <param name="settings">The Reader settings to be used during parsing.</param>
2930 /// <returns></returns>
3031 public ReadResult Read ( MemoryStream input ,
32+ Uri location ,
3133 OpenApiReaderSettings settings )
3234 {
3335 if ( input is null ) throw new ArgumentNullException ( nameof ( input ) ) ;
@@ -52,16 +54,18 @@ public ReadResult Read(MemoryStream input,
5254 } ;
5355 }
5456
55- return Read ( jsonNode , settings ) ;
57+ return Read ( jsonNode , location , settings ) ;
5658 }
5759
5860 /// <summary>
5961 /// Parses the JsonNode input into an Open API document.
6062 /// </summary>
6163 /// <param name="jsonNode">The JsonNode input.</param>
64+ /// <param name="location">Location of where the document that is getting loaded is saved</param>
6265 /// <param name="settings">The Reader settings to be used during parsing.</param>
6366 /// <returns></returns>
6467 public ReadResult Read ( JsonNode jsonNode ,
68+ Uri location ,
6569 OpenApiReaderSettings settings )
6670 {
6771 if ( jsonNode is null ) throw new ArgumentNullException ( nameof ( jsonNode ) ) ;
@@ -79,7 +83,7 @@ public ReadResult Read(JsonNode jsonNode,
7983 try
8084 {
8185 // Parse the OpenAPI Document
82- document = context . Parse ( jsonNode ) ;
86+ document = context . Parse ( jsonNode , location ) ;
8387 document . SetReferenceHostDocument ( ) ;
8488 }
8589 catch ( OpenApiException ex )
@@ -112,10 +116,12 @@ public ReadResult Read(JsonNode jsonNode,
112116 /// Reads the stream input asynchronously and parses it into an Open API document.
113117 /// </summary>
114118 /// <param name="input">Memory stream containing OpenAPI description to parse.</param>
119+ /// <param name="location">Location of where the document that is getting loaded is saved</param>
115120 /// <param name="settings">The Reader settings to be used during parsing.</param>
116121 /// <param name="cancellationToken">Propagates notifications that operations should be cancelled.</param>
117122 /// <returns></returns>
118123 public async Task < ReadResult > ReadAsync ( Stream input ,
124+ Uri location ,
119125 OpenApiReaderSettings settings ,
120126 CancellationToken cancellationToken = default )
121127 {
@@ -140,7 +146,7 @@ public async Task<ReadResult> ReadAsync(Stream input,
140146 } ;
141147 }
142148
143- return Read ( jsonNode , settings ) ;
149+ return Read ( jsonNode , location , settings ) ;
144150 }
145151
146152 /// <inheritdoc/>
0 commit comments