خرید بک لینک

Vote count: 0

I've built a RESTful API using Spray.io. It contains a number of endpoints, each of which returns JSON. I use the Spray JSON marshaller to marshal my internal objects to JSON which are returned to the user. So I have something similar to...

respondWithMediaType(`application/json`) {
        complete(MyResponse(username, password))
      }

Where MyResponse is a case class...

case class MyResponse(username:String, password:String)

However, I want to pick the fields that are returned in the response. So in this case I want to remove the "password" field before it is returned. Whats the best way to do this with Spray?

Thanks

asked 15 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 19 مرداد 1395 ساعت: 19:47

صفحه بندی