File tree 1 file changed +7
-7
lines changed
WebApiClientCore.OpenApi.SourceGenerator
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public OpenApiDoc(OpenApiDocOptions options)
38
38
{
39
39
if ( string . IsNullOrEmpty ( options . Namespace ) == false )
40
40
{
41
- this . Settings . NameSpace = options . Namespace ;
41
+ this . Settings . NameSpace = options . Namespace ;
42
42
this . Settings . CSharpGeneratorSettings . Namespace = options . Namespace ;
43
43
}
44
44
}
@@ -64,14 +64,14 @@ public OpenApiDoc(OpenApiDocument document)
64
64
private static OpenApiDocument GetDocument ( string openApi )
65
65
{
66
66
Console . WriteLine ( $ "正在分析OpenApi:{ openApi } ") ;
67
- if ( Uri . TryCreate ( openApi , UriKind . Absolute , out var _ ) == true )
67
+ if ( Uri . TryCreate ( openApi , UriKind . Absolute , out var api ) )
68
68
{
69
- return OpenApiDocument . FromUrlAsync ( openApi ) . Result ;
70
- }
71
- else
72
- {
73
- return OpenApiDocument . FromFileAsync ( openApi ) . Result ;
69
+ if ( api . Scheme . StartsWith ( Uri . UriSchemeHttp , StringComparison . OrdinalIgnoreCase ) )
70
+ {
71
+ return OpenApiDocument . FromUrlAsync ( openApi ) . Result ;
72
+ }
74
73
}
74
+ return OpenApiDocument . FromFileAsync ( openApi ) . Result ;
75
75
}
76
76
77
77
/// <summary>
You can’t perform that action at this time.
0 commit comments