-
Notifications
You must be signed in to change notification settings - Fork 6k
[Scala] add async support to Scala API client #5115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@wing328 Seems CI failed due to Go client build failure. |
|
@wing328 Yup. The async support in async-scala uses the serializers/deserializers provided by com.wordnik.swagger swagger-async-httpclient and that works for java.util.Date instead of joda DateTime. Actually this is what makes this change a breaking change. It'd be great if we can rewrite the marshalling logic. Maybe just use jackson. But that'll need some time because we can't just add a layer of facade over async-scala. I'm not sure what the current status of swagger-async-httpclient is? Is it under active development or maintenance? |
|
Travis CI reported the following issue with the Scala Petstore client: I could repeat the issue in my machine. Did you get similar errors when running |
|
I don't think https://github.com/swagger-api/swagger-async-httpclient is actively maintained as last change was almost a year ago. https://www.implicitdef.com/2015/11/19/comparing-scala-http-client-libraries.html compares differnet Scala HTTP library and the comments mentioned about akka-http, which is used by the 'akka-scala` generator in Swagger Codegen. I would suggest using |
| importMapping.put("DateTime", "org.joda.time.DateTime"); | ||
| importMapping.put("ListBuffer", "scala.collection.mutable.ListBuffer"); | ||
| importMapping.put("Date", "java.util.Date"); | ||
| importMapping.put("ListBuffer", "scala.collections.mutable.ListBuffer"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was probably missed during a merge conflict. It should be scala.collection.mutable.ListBuffer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. I'll change the underlying library to akka-http and try to consolidate all three Scala clients into one(In a separate PR later). In fact that's the one I use in my daily work.
|
@clasnake I've looked into the test failure a bit more. Here is part of the result I got when running I used The server did return 404, which indicates the order (with id 1001) is not found but somehow the Scala API client was not able to handle the 4xx status code correctly. |
|
@wing328 Thanks very much. This is very useful. I haven't got time to start the refactoring to use akka-http as the underlying library yet. I'll look into this issue during the refactoring as well. |
|
@clasnake np. I'll comment out the test case and open a new issue to track this. |
|
@wing328 Cool thanks@@ |
|
Just to clarify. Normally we don't comment out test cases. In this case, I want to avoid the PR opening for too long (as more likely merge conflicts will occur later). Scala users should use the master or stable version for the time being. I'll also update the help text to mark the Scala client generator in 2.3.0 as "beta" |
Based on #5110 (comment)