Created
November 11, 2011 19:06
-
-
Save berngp/1358895 to your computer and use it in GitHub Desktop.
Lift RestHelper and the SI-1133
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fails with https://issues.scala-lang.org/browse/SI-1133 | |
* Workaround: Split the <i>cases</i> inside <i>serve</i> into two or more | |
* <i>serve</i> blocks. | |
* | |
* Note: To avoid noise all cases bellow are returning a NotFoundResponse(). | |
*/ | |
object CategoryAdminResource extends RestHelper with Loggable { | |
serve("api" / "categories" prefix { | |
case "tags" :: tag :: Nil JsonGet _ => NotFoundResponse() //... | |
case Category(category) :: "tags" :: Nil JsonGet _ => NotFoundResponse() //... | |
case Category(category) :: "tags" :: tagSlug :: Nil JsonGet _ => NotFoundResponse() //... | |
case Category(category) :: Nil JsonGet _ => NotFoundResponse() //... | |
case Category(category) :: "tags" :: Nil JsonPut json -> _ => NotFoundResponse() //... | |
case Category(category) :: "tags" :: tagSlug :: Nil JsonDelete _ => NotFoundResponse() //... | |
case Category(category) :: "tags" :: tagSlug :: Nil JsonPost json -> _ => NotFoundResponse() //... | |
case Nil JsonGet _ => NotFoundResponse() //... | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment