If you use the openapi-generator you can modify the templates (also described here) yourself to add the decodeSlash
Parameter:
git clone https://github.com/openapitools/openapi-generator
cd openapi-generator
git checkout v4.2.0 # The Version Tag you are actually using
cd modules/openapi-generator/src/main/resources/Java/libraries/feign/
cp api.mustache <your_local_project>/src/main/resources/Java/libraries/feign
In api.mustache
change the 2 appearances of @RequestLine
:
- @RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}")
+ @RequestLine(value="{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}", decodeSlash = false)
- @RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}")
+ @RequestLine(value="{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}", decodeSlash = false)
Using the openapi-generator-maven-plugin
add the templateDirectory
to the <configuration>
block:
<templateDirectory>src/main/resources/Java/libraries/feign</templateDirectory>