Damian
Damian

Reputation: 613

Scala 2.13 migration

I am migrating Play 2.8.8 project from Scala 2.12 to 2.13.

I have a really weird error in the Play routes file:

method right in class Either is deprecated (since 2.13.0): Either is now right-biased, use methods directly on Either

There is no .right calls in the routes file, in the generated Scala routes file or in the related controllers.

Route file:

POST          /roles/:id        controllers.Authentication.api.RolesResource.addRoleToAccount(id:models.users.AccountId)
DELETE        /roles/:id        controllers.Authentication.api.RolesResource.removeRoleFromAccount(id:models.users.AccountId)
GET           /roles/:id        controllers.Authentication.api.RolesResource.getRolesForAccount(id:models.users.AccountId)

Thanks for any guidance what might be the source of this error.

Upvotes: 3

Views: 390

Answers (1)

Damian
Damian

Reputation: 613

I think the reason is in play.core.routing.GeneratedRouter class.

From my route file this method:

    (for {
a1 <- pa1.value.right
 a2 <- pa2.value.right}
      yield (a1, a2))
      .fold(badRequest, { case (a1, a2) => generator(a1, a2) })
  }

It contains calls to deprecated .right function.

Upvotes: 1

Related Questions