diff options
author | Li Haoyi <haoyi.li@databricks.com> | 2019-09-14 18:34:57 +0800 |
---|---|---|
committer | Li Haoyi <haoyi.li@databricks.com> | 2019-09-14 18:36:52 +0800 |
commit | 85e982a6bf9bd82524baf53546b31d85b426fa62 (patch) | |
tree | 4504cdc4f11543dcbeec3496707b95a464b70b86 /example/endpoints/app/src/Endpoints.scala | |
parent | 2c1dcc3cd33fbd2c2c921f20f67c45ce48c1e8bc (diff) | |
download | cask-85e982a6bf9bd82524baf53546b31d85b426fa62.tar.gz cask-85e982a6bf9bd82524baf53546b31d85b426fa62.tar.bz2 cask-85e982a6bf9bd82524baf53546b31d85b426fa62.zip |
`InnerResponse` is now a type param instead of member, allowing better error messages through `cask.internal.Conversion`:
```
Cannot return java.io.ByteArrayInputStream as a cask.model.Response[cask.endpoints.JsonData]
```
Diffstat (limited to 'example/endpoints/app/src/Endpoints.scala')
-rw-r--r-- | example/endpoints/app/src/Endpoints.scala | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/example/endpoints/app/src/Endpoints.scala b/example/endpoints/app/src/Endpoints.scala index b934769..97da526 100644 --- a/example/endpoints/app/src/Endpoints.scala +++ b/example/endpoints/app/src/Endpoints.scala @@ -1,8 +1,7 @@ package app -class custom(val path: String, val methods: Seq[String]) extends cask.Endpoint{ +class custom(val path: String, val methods: Seq[String]) extends cask.Endpoint[Int]{ type Output = Int - type InnerReturned = Int def wrapFunction(ctx: cask.Request, delegate: Delegate): OuterReturned = { delegate(Map()).map{num => cask.Response("Echo " + num, statusCode = num) |