@@ -84,7 +84,6 @@ public Map<Request, List<ProxyMethod>> map(Operation operation) {
8484 ProxyMethod .Builder builder = createProxyMethodBuilder ()
8585 .description (operation .getDescription ())
8686 .name (operationName )
87- .specialHeaders (operation .getSpecialHeaders ())
8887 .isResumable (false );
8988
9089 String operationId = operation .getOperationId ();
@@ -199,6 +198,11 @@ public Map<Request, List<ProxyMethod>> map(Operation operation) {
199198 }
200199 }
201200 List <ProxyMethodParameter > specialParameters = getSpecialParameters (operation );
201+ if (!CoreUtils .isNullOrEmpty (specialParameters )) {
202+ builder .specialHeaders (specialParameters .stream ()
203+ .map (ProxyMethodParameter ::getRequestParameterName )
204+ .collect (Collectors .toList ()));
205+ }
202206 if (!settings .isDataPlaneClient ()) {
203207 parameters .addAll (specialParameters );
204208 }
@@ -723,8 +727,7 @@ protected List<ProxyMethodParameter> getSpecialParameters(Operation operation) {
723727 List <String > specialHeaders = operation .getSpecialHeaders ().stream ()
724728 .map (s -> s .toLowerCase (Locale .ROOT ))
725729 .collect (Collectors .toList ());
726- boolean supportRepeatabilityRequest = specialHeaders .contains (MethodUtil .REPEATABILITY_REQUEST_ID_HEADER )
727- && specialHeaders .contains (MethodUtil .REPEATABILITY_FIRST_SENT_HEADER );
730+ boolean supportRepeatabilityRequest = specialHeaders .contains (MethodUtil .REPEATABILITY_REQUEST_ID_HEADER );
728731 if (supportRepeatabilityRequest ) {
729732 Function <ProxyMethodParameter .Builder , ProxyMethodParameter .Builder > commonBuilderSetting = builder -> {
730733 builder .rawType (ClassType .STRING )
@@ -743,12 +746,14 @@ protected List<ProxyMethodParameter> getSpecialParameters(Operation operation) {
743746 .requestParameterName (MethodUtil .REPEATABILITY_REQUEST_ID_HEADER )
744747 .description ("Repeatability request ID header" ))
745748 .build ());
746- specialParameters .add (commonBuilderSetting .apply (new ProxyMethodParameter .Builder ()
747- .name (MethodUtil .REPEATABILITY_FIRST_SENT_VARIABLE_NAME )
748- .parameterReference (MethodUtil .REPEATABILITY_FIRST_SENT_EXPRESSION )
749- .requestParameterName (MethodUtil .REPEATABILITY_FIRST_SENT_HEADER )
750- .description ("Repeatability first sent header as HTTP-date" ))
751- .build ());
749+ if (specialHeaders .contains (MethodUtil .REPEATABILITY_FIRST_SENT_HEADER )) {
750+ specialParameters .add (commonBuilderSetting .apply (new ProxyMethodParameter .Builder ()
751+ .name (MethodUtil .REPEATABILITY_FIRST_SENT_VARIABLE_NAME )
752+ .parameterReference (MethodUtil .REPEATABILITY_FIRST_SENT_EXPRESSION )
753+ .requestParameterName (MethodUtil .REPEATABILITY_FIRST_SENT_HEADER )
754+ .description ("Repeatability first sent header as HTTP-date" ))
755+ .build ());
756+ }
752757 }
753758 }
754759 }
0 commit comments