@@ -1677,27 +1677,6 @@ const hasApiVersionParameter = (apiPath, opts, paths) => {
16771677 return messages ;
16781678} ;
16791679
1680- const hasHeader = ( response , opts , paths ) => {
1681- if ( response === null || typeof response !== 'object' ) {
1682- return [ ] ;
1683- }
1684- if ( opts === null || typeof opts !== 'object' || ! opts . name ) {
1685- return [ ] ;
1686- }
1687- const path = paths . path || [ ] ;
1688- const hasHeader = Object . keys ( response . headers || { } )
1689- . some ( ( name ) => name . toLowerCase ( ) === opts . name . toLowerCase ( ) ) ;
1690- if ( ! hasHeader ) {
1691- return [
1692- {
1693- message : `Response should include an "${ opts . name } " response header.` ,
1694- path : [ ...path , 'headers' ] ,
1695- } ,
1696- ] ;
1697- }
1698- return [ ] ;
1699- } ;
1700-
17011680const httpsSupportedScheme = ( scheme , _opts , paths ) => {
17021681 if ( scheme == null || typeof scheme !== "object" )
17031682 return [ ] ;
@@ -3301,22 +3280,6 @@ const ruleset = {
33013280 function : provisioningState ,
33023281 } ,
33033282 } ,
3304- LroLocationHeader : {
3305- rpcGuidelineCode : "RPC-Async-V1-07" ,
3306- description : "Location header must be supported for all async operations that return 202." ,
3307- message : "A 202 response should include an Location response header." ,
3308- severity : "error" ,
3309- disableForTypeSpecDataPlane : true ,
3310- disableForTypeSpecDataPlaneReason : "Covered by TSP's '@azure-tools/typespec-azure-resource-manager/arm-location-header' rule." ,
3311- formats : [ oas2 ] ,
3312- given : "$.paths[*][*].responses[?(@property == '202')]" ,
3313- then : {
3314- function : hasHeader ,
3315- functionOptions : {
3316- name : "Location" ,
3317- } ,
3318- } ,
3319- } ,
33203283 PostResponseCodes : {
33213284 rpcGuidelineCode : "RPC-Async-V1-11, RPC-Async-V1-14" ,
33223285 description : "Synchronous POST must have either 200 or 204 return codes and LRO POST must have 202 return code. LRO POST should also have a 200 return code only if the final response is intended to have a schema" ,
0 commit comments