@@ -21,7 +21,7 @@ namespace Microsoft.OpenApi.Hidi
21
21
public static class OpenApiService
22
22
{
23
23
public static void ProcessOpenApiDocument (
24
- string input ,
24
+ string openapi ,
25
25
FileInfo output ,
26
26
OpenApiSpecVersion ? version ,
27
27
OpenApiFormat ? format ,
@@ -31,9 +31,9 @@ public static void ProcessOpenApiDocument(
31
31
bool inline ,
32
32
bool resolveExternal )
33
33
{
34
- if ( string . IsNullOrEmpty ( input ) )
34
+ if ( string . IsNullOrEmpty ( openapi ) )
35
35
{
36
- throw new ArgumentNullException ( nameof ( input ) ) ;
36
+ throw new ArgumentNullException ( nameof ( openapi ) ) ;
37
37
}
38
38
if ( output == null )
39
39
{
@@ -44,7 +44,7 @@ public static void ProcessOpenApiDocument(
44
44
throw new IOException ( "The file you're writing to already exists. Please input a new output path." ) ;
45
45
}
46
46
47
- var stream = GetStream ( input ) ;
47
+ var stream = GetStream ( openapi ) ;
48
48
var result = new OpenApiStreamReader ( new OpenApiReaderSettings
49
49
{
50
50
ReferenceResolution = resolveExternal ? ReferenceResolutionSetting . ResolveAllReferences : ReferenceResolutionSetting . ResolveLocalReferences ,
@@ -102,7 +102,7 @@ public static void ProcessOpenApiDocument(
102
102
ReferenceInline = inline ? ReferenceInlineSetting . InlineLocalReferences : ReferenceInlineSetting . DoNotInlineReferences
103
103
} ;
104
104
105
- var openApiFormat = format ?? GetOpenApiFormat ( input ) ;
105
+ var openApiFormat = format ?? GetOpenApiFormat ( openapi ) ;
106
106
var openApiVersion = version ?? result . OpenApiDiagnostic . SpecificationVersion ;
107
107
IOpenApiWriter writer = openApiFormat switch
108
108
{
@@ -115,10 +115,10 @@ public static void ProcessOpenApiDocument(
115
115
textWriter . Flush ( ) ;
116
116
}
117
117
118
- private static Stream GetStream ( string input )
118
+ private static Stream GetStream ( string openapi )
119
119
{
120
120
Stream stream ;
121
- if ( input . StartsWith ( "http" ) )
121
+ if ( openapi . StartsWith ( "http" ) )
122
122
{
123
123
var httpClient = new HttpClient ( new HttpClientHandler ( )
124
124
{
@@ -127,11 +127,11 @@ private static Stream GetStream(string input)
127
127
{
128
128
DefaultRequestVersion = HttpVersion . Version20
129
129
} ;
130
- stream = httpClient . GetStreamAsync ( input ) . Result ;
130
+ stream = httpClient . GetStreamAsync ( openapi ) . Result ;
131
131
}
132
132
else
133
133
{
134
- var fileInput = new FileInfo ( input ) ;
134
+ var fileInput = new FileInfo ( openapi ) ;
135
135
stream = fileInput . OpenRead ( ) ;
136
136
}
137
137
@@ -170,14 +170,14 @@ public static Dictionary<string, List<string>> ParseJsonCollectionFile(Stream st
170
170
return requestUrls ;
171
171
}
172
172
173
- internal static void ValidateOpenApiDocument ( string input )
173
+ internal static void ValidateOpenApiDocument ( string openapi )
174
174
{
175
- if ( input == null )
175
+ if ( openapi == null )
176
176
{
177
- throw new ArgumentNullException ( "input " ) ;
177
+ throw new ArgumentNullException ( "openapi " ) ;
178
178
}
179
179
180
- var stream = GetStream ( input ) ;
180
+ var stream = GetStream ( openapi ) ;
181
181
182
182
OpenApiDocument document ;
183
183
@@ -202,9 +202,9 @@ internal static void ValidateOpenApiDocument(string input)
202
202
Console . WriteLine ( statsVisitor . GetStatisticsReport ( ) ) ;
203
203
}
204
204
205
- private static OpenApiFormat GetOpenApiFormat ( string input )
205
+ private static OpenApiFormat GetOpenApiFormat ( string openapi )
206
206
{
207
- return ! input . StartsWith ( "http" ) && Path . GetExtension ( input ) == ".json" ? OpenApiFormat . Json : OpenApiFormat . Yaml ;
207
+ return ! openapi . StartsWith ( "http" ) && Path . GetExtension ( openapi ) == ".json" ? OpenApiFormat . Json : OpenApiFormat . Yaml ;
208
208
}
209
209
}
210
210
}
0 commit comments