play-api-rest-seed icon indicating copy to clipboard operation
play-api-rest-seed copied to clipboard

error when using play 2.6.0

Open thinkrapido opened this issue 7 years ago • 6 comments

/*
* ApiRequestHeader for requests that don't require authentication
*/
class ApiRequest[A](val request: Request[A]) extends WrappedRequest[A](request) with ApiRequestHeader[Request[A]] {
  override def remoteAddress = request.remoteAddress
  override def method = request.method
  override def uri = request.uri
  override def maybeBody: Option[String] = request.body match {
    case body: JsValue => Some(Json.prettyPrint(body))
    case body: String => if (body.length > 0) Some(body) else None
    case body => Some(body.toString)
  }
}

with play 2.6.0 RequestHeader has changed and remoteAddress and uri cannot be overridden here because of 'final' declaration

Adrian, do you have any suggestions how to fix this?

thinkrapido avatar Jun 26 '17 17:06 thinkrapido

Sorry, but I haven't updated the repository to Play 2.6 yet. Meanwhile, you can check the migration guide.

adrianhurt avatar Jun 26 '17 18:06 adrianhurt

Any plans to update to Play 2.6?

aneeshde avatar Jun 29 '18 00:06 aneeshde

I did it to play 2.6 and for now we use it without problems, if you want I take the time to update it ...

ghost avatar Sep 21 '18 14:09 ghost

I did it to play 2.6 and for now we use it without problems, if you want I take the time to update it ...

Hey, do you have an example of this somewhere? Would love to see!

g12mcgov avatar Oct 01 '18 01:10 g12mcgov

Not, but in max one week i push the changes... in my fork code...and I notify you

ghost avatar Oct 09 '18 14:10 ghost

He did not let me go up: image

You can see the changes in my fork: https://github.com/rechemendia/play-api-rest-seed/commit/46cf06641aed5d4c631e8a1f96502a1606d6e439

See in builds.sbt: //TODO: sorry, I do not use it, see more -> https://github.com/sbt/sbt-scalariform //scalariformItSettings

regards

ghost avatar Oct 14 '18 04:10 ghost