@@ -25,9 +25,11 @@ public class OpenApiJsonReader : IOpenApiReader
25
25
/// Reads the memory stream input and parses it into an Open API document.
26
26
/// </summary>
27
27
/// <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>
28
29
/// <param name="settings">The Reader settings to be used during parsing.</param>
29
30
/// <returns></returns>
30
31
public ReadResult Read ( MemoryStream input ,
32
+ Uri location ,
31
33
OpenApiReaderSettings settings )
32
34
{
33
35
if ( input is null ) throw new ArgumentNullException ( nameof ( input ) ) ;
@@ -52,16 +54,18 @@ public ReadResult Read(MemoryStream input,
52
54
} ;
53
55
}
54
56
55
- return Read ( jsonNode , settings ) ;
57
+ return Read ( jsonNode , location , settings ) ;
56
58
}
57
59
58
60
/// <summary>
59
61
/// Parses the JsonNode input into an Open API document.
60
62
/// </summary>
61
63
/// <param name="jsonNode">The JsonNode input.</param>
64
+ /// <param name="location">Location of where the document that is getting loaded is saved</param>
62
65
/// <param name="settings">The Reader settings to be used during parsing.</param>
63
66
/// <returns></returns>
64
67
public ReadResult Read ( JsonNode jsonNode ,
68
+ Uri location ,
65
69
OpenApiReaderSettings settings )
66
70
{
67
71
if ( jsonNode is null ) throw new ArgumentNullException ( nameof ( jsonNode ) ) ;
@@ -79,7 +83,7 @@ public ReadResult Read(JsonNode jsonNode,
79
83
try
80
84
{
81
85
// Parse the OpenAPI Document
82
- document = context . Parse ( jsonNode ) ;
86
+ document = context . Parse ( jsonNode , location ) ;
83
87
document . SetReferenceHostDocument ( ) ;
84
88
}
85
89
catch ( OpenApiException ex )
@@ -115,10 +119,12 @@ public ReadResult Read(JsonNode jsonNode,
115
119
/// Reads the stream input asynchronously and parses it into an Open API document.
116
120
/// </summary>
117
121
/// <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>
118
123
/// <param name="settings">The Reader settings to be used during parsing.</param>
119
124
/// <param name="cancellationToken">Propagates notifications that operations should be cancelled.</param>
120
125
/// <returns></returns>
121
126
public async Task < ReadResult > ReadAsync ( Stream input ,
127
+ Uri location ,
122
128
OpenApiReaderSettings settings ,
123
129
CancellationToken cancellationToken = default )
124
130
{
@@ -144,7 +150,7 @@ public async Task<ReadResult> ReadAsync(Stream input,
144
150
} ;
145
151
}
146
152
147
- return Read ( jsonNode , settings ) ;
153
+ return Read ( jsonNode , location , settings ) ;
148
154
}
149
155
150
156
/// <inheritdoc/>
0 commit comments