Skip to content
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

scaladsl.model.HttpResponse.withStatus return javadsl.model.HttpResponse #1623

Closed
carstenlenz opened this issue Dec 14, 2017 · 3 comments
Closed
Labels
1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted t:core Issues related to the akka-http-core module t:model Issues around the model classes and its functionality
Milestone

Comments

@carstenlenz
Copy link

Hi.

the following code snippet will not compile:

import akka.http.scaladsl.model.{HttpResponse, StatusCodes}

val response: HttpResponse = HttpResponse().withStatus(StatusCodes.NotFound)

because the .withStatus() method return a javadsl.model.HttpResponse.

Expectation: is should return scaladsl.model.HttpResponse and the code should compile.

Opening this after a short discussion in the Gitter channel by request of @johanandren

@jrudolph jrudolph added 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted t:core Issues related to the akka-http-core module t:model Issues around the model classes and its functionality labels Dec 14, 2017
@jrudolph
Copy link
Member

Thanks, we seem to be indeed missing overloads that return the more specific Scala types. Weird, that no one noticed so far.

@carstenlenz
Copy link
Author

Yes - that is why I thought that there is a surely a reason for having it this way. ;)

jlprat added a commit to jlprat/akka-http that referenced this issue Dec 19, 2017
Refs: akka#1623
Changed the return type to the corresponding Scala DSL one
jrudolph added a commit that referenced this issue Dec 21, 2017
…th-methods

=htc Fix return type for `withStatus` methods #1623
@jrudolph jrudolph added this to the 10.1.0 milestone Dec 21, 2017
@jrudolph
Copy link
Member

Fixed by #1664.

jrudolph pushed a commit to jrudolph/akka-http that referenced this issue Jan 8, 2018
…kka#1623

Refs: akka#1623
Changed the return type to the corresponding Scala DSL one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted t:core Issues related to the akka-http-core module t:model Issues around the model classes and its functionality
Projects
None yet
Development

No branches or pull requests

2 participants