@@ -67,7 +67,6 @@ import {
6767 getHttpOperationWithCache ,
6868 getWireName ,
6969 isApiVersion ,
70- isInternal ,
7170 isSdkBuiltInKind ,
7271 isSdkIntKind ,
7372 listClients ,
@@ -116,10 +115,8 @@ import {
116115 Visibility ,
117116 getAuthentication ,
118117 getHeaderFieldName ,
119- getHeaderFieldOptions ,
120118 getPathParamName ,
121119 getQueryParamName ,
122- getQueryParamOptions ,
123120 getServers ,
124121 getStatusCodeDescription ,
125122 isHeader ,
@@ -306,6 +303,7 @@ export class CodeModelBuilder {
306303 } ,
307304 } ,
308305 extensions : {
306+ // TODO: deprecate this logic of string/url for x-ms-skip-url-encoding
309307 "x-ms-skip-url-encoding" : schema instanceof UriSchema ,
310308 } ,
311309 // // make the logic same as TCGC, which takes the server-side default of host as client-side default
@@ -401,14 +399,12 @@ export class CodeModelBuilder {
401399 return ! this . options [ "flavor" ] || this . options [ "flavor" ] . toLocaleLowerCase ( ) === "azure" ;
402400 }
403401
404- private isInternal ( context : SdkContext , operation : Operation ) : boolean {
402+ private isInternal ( operation : Operation ) : boolean {
405403 const access = getAccess ( operation ) ;
406404 if ( access ) {
407405 return access === "internal" ;
408406 } else {
409- // TODO: deprecate "internal"
410- // eslint-disable-next-line deprecation/deprecation
411- return isInternal ( context , operation ) ;
407+ return false ;
412408 }
413409 }
414410
@@ -759,7 +755,7 @@ export class CodeModelBuilder {
759755 this . sdkContext ,
760756 operation ,
761757 ) ;
762- codeModelOperation . internalApi = this . isInternal ( this . sdkContext , operation ) ;
758+ codeModelOperation . internalApi = this . isInternal ( operation ) ;
763759
764760 const convenienceApiName = this . getConvenienceApiName ( operation ) ;
765761 let generateConvenienceApi : boolean = Boolean ( convenienceApiName ) ;
@@ -1072,14 +1068,22 @@ export class CodeModelBuilder {
10721068 schema = this . processSchemaFromSdkType ( sdkType , param . param . name ) ;
10731069 }
10741070
1075- // skip-url-encoding
10761071 let extensions : { [ id : string ] : any } | undefined = undefined ;
1072+ // skip-url-encoding
1073+ if ( param . type === "path" ) {
1074+ if ( param . allowReserved ) {
1075+ extensions = extensions ?? { } ;
1076+ extensions [ "x-ms-skip-url-encoding" ] = true ;
1077+ }
1078+ }
1079+ // TODO: deprecate this logic of string/url for x-ms-skip-url-encoding
10771080 if (
10781081 ( param . type === "query" || param . type === "path" ) &&
10791082 param . param . type . kind === "Scalar" &&
10801083 schema instanceof UriSchema
10811084 ) {
1082- extensions = { "x-ms-skip-url-encoding" : true } ;
1085+ extensions = extensions ?? { } ;
1086+ extensions [ "x-ms-skip-url-encoding" ] = true ;
10831087 }
10841088
10851089 if ( this . supportsAdvancedVersioning ( ) ) {
@@ -1096,9 +1100,8 @@ export class CodeModelBuilder {
10961100 let explode = undefined ;
10971101 if ( param . param . type . kind === "Model" && isArrayModelType ( this . program , param . param . type ) ) {
10981102 if ( param . type === "query" ) {
1099- const queryParamOptions = getQueryParamOptions ( this . program , param . param ) ;
11001103 // eslint-disable-next-line deprecation/deprecation
1101- const queryParamFormat = queryParamOptions ?. format ;
1104+ const queryParamFormat = param ?. format ;
11021105 if ( queryParamFormat ) {
11031106 switch ( queryParamFormat ) {
11041107 case "csv" :
@@ -1128,17 +1131,16 @@ export class CodeModelBuilder {
11281131 }
11291132 }
11301133 } else if ( param . type === "header" ) {
1131- const headerFieldOptions = getHeaderFieldOptions ( this . program , param . param ) ;
1132- switch ( headerFieldOptions ?. format ) {
1133- case "csv" :
1134- style = SerializationStyle . Simple ;
1135- break ;
1136-
1137- default :
1138- if ( headerFieldOptions ?. format ) {
1139- this . logWarning ( `Unrecognized header parameter format: '${ headerFieldOptions ?. format } '.` ) ;
1140- }
1141- break ;
1134+ if ( param . format ) {
1135+ switch ( param . format ) {
1136+ case "csv" :
1137+ style = SerializationStyle . Simple ;
1138+ break ;
1139+
1140+ default :
1141+ this . logWarning ( `Unrecognized header parameter format: '${ param . format } '.` ) ;
1142+ break ;
1143+ }
11421144 }
11431145 }
11441146 }
0 commit comments