@@ -597,8 +597,11 @@ protected void normalizePaths() {
597597
598598 // normalize PathItem common parameters
599599 normalizeParameters (pathsEntry .getKey (), path , null , path .getParameters ());
600- if (path .getParameters () != null && path .getParameters ().isEmpty ()) {
601- path .setParameters (null );
600+ if (removeFilter .hasFilter ()) {
601+ // for backward compatibility, keep empty parameters if not removeFilter
602+ if (path .getParameters () != null && path .getParameters ().isEmpty ()) {
603+ path .setParameters (null );
604+ }
602605 }
603606
604607 if (removeFilter .hasFilter ()) {
@@ -613,8 +616,11 @@ protected void normalizePaths() {
613616 normalizeOperation (operation );
614617 normalizeRequestBody (operation );
615618 normalizeParameters (pathsEntry .getKey (), path , operation , operation .getParameters ());
616- if (operation .getParameters () != null && operation .getParameters ().isEmpty ()) {
617- operation .setParameters (null );
619+ if (removeFilter .hasFilter ()) {
620+ // just for backward compatibility
621+ if (operation .getParameters () != null && operation .getParameters ().isEmpty ()) {
622+ operation .setParameters (null );
623+ }
618624 }
619625 normalizeResponses (operation );
620626 }
0 commit comments