You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#6540 implemented support for collections, but I don't think it ever worked properly, at least for parameters. Notably, adding an escape() function for List[String] is useless when invokeApi's queryParams is Map[String, String].
Suggest a fix/enhancement
Serialization should be addressed inside api.mustache, replacing/augmenting param.toString call with a call to escape() instead. Also see java's parameterToString() as another valid approach.
The text was updated successfully, but these errors were encountered:
bchess
changed the title
[SCALA] Collection parameters not serializing properly
[Scala] Collection parameters not serializing properly
Dec 13, 2017
Description
Collection parameters get serialized via toString(), resulting in URL parameters like List%28123%29 for List(123).
Swagger-codegen version
2.3.0
Swagger declaration file content or url
Command line used for generation
java -jar swagger-codegen.jar generate --lang scala -i collection-issue.json
Steps to reproduce
Start a simple webserver on 8080
python -m SimpleHTTPServer 8080
Observe:
127.0.0.1 - - [13/Dec/2017 15:29:19] "GET /hi?numbers=List%281%2C%202%2C%203%29 HTTP/1.1" 404 -
Related issues/PRs
#6540 implemented support for collections, but I don't think it ever worked properly, at least for parameters. Notably, adding an escape() function for List[String] is useless when invokeApi's queryParams is Map[String, String].
Suggest a fix/enhancement
Serialization should be addressed inside api.mustache, replacing/augmenting
param.toString
call with a call to escape() instead. Also see java's parameterToString() as another valid approach.The text was updated successfully, but these errors were encountered: