@@ -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 )
@@ -115,10 +119,12 @@ public ReadResult Read(JsonNode jsonNode,
115119 /// Reads the stream input asynchronously and parses it into an Open API document.
116120 /// </summary>
117121 /// <param name="input">Memory stream containing OpenAPI description to parse.</param>
122+ /// <param name="location">Location of where the document that is getting loaded is saved</param>
118123 /// <param name="settings">The Reader settings to be used during parsing.</param>
119124 /// <param name="cancellationToken">Propagates notifications that operations should be cancelled.</param>
120125 /// <returns></returns>
121126 public async Task < ReadResult > ReadAsync ( Stream input ,
127+ Uri location ,
122128 OpenApiReaderSettings settings ,
123129 CancellationToken cancellationToken = default )
124130 {
@@ -144,7 +150,7 @@ public async Task<ReadResult> ReadAsync(Stream input,
144150 } ;
145151 }
146152
147- return Read ( jsonNode , settings ) ;
153+ return Read ( jsonNode , location , settings ) ;
148154 }
149155
150156 /// <inheritdoc/>
0 commit comments