File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
WebApiClientCore.OpenApi.SourceGenerator Expand file tree Collapse file tree 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)
3838 {
3939 if ( string . IsNullOrEmpty ( options . Namespace ) == false )
4040 {
41- this . Settings . NameSpace = options . Namespace ;
41+ this . Settings . NameSpace = options . Namespace ;
4242 this . Settings . CSharpGeneratorSettings . Namespace = options . Namespace ;
4343 }
4444 }
@@ -64,14 +64,14 @@ public OpenApiDoc(OpenApiDocument document)
6464 private static OpenApiDocument GetDocument ( string openApi )
6565 {
6666 Console . WriteLine ( $ "正在分析OpenApi:{ openApi } ") ;
67- if ( Uri . TryCreate ( openApi , UriKind . Absolute , out var _ ) == true )
67+ if ( Uri . TryCreate ( openApi , UriKind . Absolute , out var api ) )
6868 {
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+ }
7473 }
74+ return OpenApiDocument . FromFileAsync ( openApi ) . Result ;
7575 }
7676
7777 /// <summary>
You can’t perform that action at this time.
0 commit comments