@@ -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 )
@@ -112,10 +116,12 @@ public ReadResult Read(JsonNode jsonNode,
112
116
/// Reads the stream input asynchronously and parses it into an Open API document.
113
117
/// </summary>
114
118
/// <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>
115
120
/// <param name="settings">The Reader settings to be used during parsing.</param>
116
121
/// <param name="cancellationToken">Propagates notifications that operations should be cancelled.</param>
117
122
/// <returns></returns>
118
123
public async Task < ReadResult > ReadAsync ( Stream input ,
124
+ Uri location ,
119
125
OpenApiReaderSettings settings ,
120
126
CancellationToken cancellationToken = default )
121
127
{
@@ -140,7 +146,7 @@ public async Task<ReadResult> ReadAsync(Stream input,
140
146
} ;
141
147
}
142
148
143
- return Read ( jsonNode , settings ) ;
149
+ return Read ( jsonNode , location , settings ) ;
144
150
}
145
151
146
152
/// <inheritdoc/>
0 commit comments