swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

URL parameters in GET request would not ge properly url-encoded

Open pakaufmann opened this issue 6 years ago • 4 comments

The + sign would not get encoded, but decoded, resulting in a space, which in turn resulted in invalid parameters on the server side.

This should fix this issue https://github.com/swagger-api/swagger-codegen/issues/7747.

As the encode() in RestTemplate only works when using expanded variables (https://github.com/spring-projects/spring-framework/issues/21577), instead of directly adding the parameters to the queryParams, this creates variables which are expanded for all inputted query params.

pakaufmann avatar Apr 18 '19 12:04 pakaufmann

Ok, so apparently this cannot be achieved in Sprint 4.3.9 (or any Spring 4 version for that matter). So, can the Rest-Template be updated to Spring 5? Or is this not wanted, as it should work with Spring 4?

pakaufmann avatar Apr 18 '19 16:04 pakaufmann

So, instead of trying to make it backwards-compatible I added a new config-parameter "spring5". If activated it generates the demo client with spring5, which then fixes the bug there. Per default it is deactivated in order to stay backwards compatible.

pakaufmann avatar Apr 24 '19 14:04 pakaufmann

Hey guys, Any decision on this one, This is really important and breaks many things.

mangatmodi avatar Jun 27 '19 09:06 mangatmodi

Why is this fix after 5 years still not merged? Who can merge this pull request?

durcon avatar Mar 27 '24 08:03 durcon