1

Our database (which uses slick datamapper pattern, so our models are simple case classes which is ideal for commands) has many ADT's as fields (i.e. abstract sealed class with many case classes/case objects as children), and the idea is that our parameters (which is obviously going to be a string from within the params object) is going to converted to one of these types with a custom method

How would you go about creating a custom asType[T] for some type T from the string that you get from params when using Scalatra commands?

For more info on Scalatra commands, you can read here http://www.scalatra.org/guides/formats/commands.html

mdedetrich
  • 1,899
  • 1
  • 18
  • 29
  • I found this [forum post](https://groups.google.com/forum/#!msg/scalatra-user/yhMNhYQS6lU/tJBOcWxXJu4J) In scalatra 2.3.0, it looks like they are making it easier to type convert with safe()/safeOption() - see Ivan's links from that post. – n0741337 Feb 20 '14 at 17:11

0 Answers0