@@ -8,7 +8,6 @@ namespace AutoSDK.Models;
88
99public record struct EndPoint (
1010 string Id ,
11- string Namespace ,
1211 string ClassName ,
1312 string BaseUrl ,
1413 bool Stream ,
@@ -24,6 +23,7 @@ public record struct EndPoint(
2423 string Summary ,
2524 string BaseUrlSummary ,
2625 Settings Settings ,
26+ Settings GlobalSettings ,
2727 bool IsDeprecated ,
2828 string ExperimentalStage ,
2929 TypeData RequestType
@@ -33,23 +33,23 @@ TypeData RequestType
3333 public string NotAsyncMethodName => Id . ToPropertyName ( ) ;
3434 public bool IsMultipartFormData => RequestMediaType == "multipart/form-data" ;
3535
36- public string FileNameWithoutExtension => $ "{ Namespace } .{ ClassName } .{ Id . ToPropertyName ( ) } ";
36+ public string FileNameWithoutExtension => $ "{ Settings . Namespace } .{ ClassName } .{ Id . ToPropertyName ( ) } ";
3737
38- public string InterfaceFileNameWithoutExtension => $ "{ Namespace } .I{ ClassName } .{ Id . ToPropertyName ( ) } ";
38+ public string InterfaceFileNameWithoutExtension => $ "{ Settings . Namespace } .I{ ClassName } .{ Id . ToPropertyName ( ) } ";
3939
4040 public static EndPoint FromSchema ( OperationContext operation )
4141 {
4242 operation = operation ?? throw new ArgumentNullException ( nameof ( operation ) ) ;
4343
4444 var authorizations = operation . Operation . Security
4545 . SelectMany ( x => x )
46- . Select ( x => Authorization . FromOpenApiSecurityScheme ( x . Key , operation . Settings ) )
46+ . Select ( x => Authorization . FromOpenApiSecurityScheme ( x . Key , operation . Settings , operation . GlobalSettings ) )
4747 . ToImmutableArray ( ) ;
4848 if ( authorizations . Length == 0 )
4949 {
5050 authorizations = operation . GlobalSecurityRequirements
5151 . SelectMany ( x => x )
52- . Select ( x => Authorization . FromOpenApiSecurityScheme ( x . Key , operation . Settings ) )
52+ . Select ( x => Authorization . FromOpenApiSecurityScheme ( x . Key , operation . Settings , operation . GlobalSettings ) )
5353 . ToImmutableArray ( ) ;
5454 }
5555
@@ -138,7 +138,6 @@ public static EndPoint FromSchema(OperationContext operation)
138138 var firstTag = ( operation . Operation . Tags ?? [ ] ) . FirstOrDefault ( ) ;
139139 var endPoint = new EndPoint (
140140 Id : operation . MethodName ,
141- Namespace : operation . Settings . Namespace ,
142141 ClassName : operation . Settings . GroupByTags && firstTag != null
143142 ? ClientNameGenerator . Generate ( operation . Settings , firstTag )
144143 : operation . Settings . ClassName . Replace ( "." , string . Empty ) ,
@@ -163,6 +162,7 @@ public static EndPoint FromSchema(OperationContext operation)
163162 Summary : operation . Operation . GetXmlDocumentationSummary ( ) ,
164163 BaseUrlSummary : string . Empty ,
165164 Settings : operation . Settings ,
165+ GlobalSettings : operation . GlobalSettings ,
166166 IsDeprecated : operation . Operation . Deprecated ,
167167 ExperimentalStage : operation . Operation . GetExperimentalStage ( ) ,
168168 RequestType : requestType ?? TypeData . Default ) ;
0 commit comments