Created
August 20, 2015 16:46
-
-
Save maciej/9c9ff1eb6bdea016a0e5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import com.softwaremill.thegarden.lawn.base.StringExtensions._ | |
| trait SnakeCaseJsonProtocol extends DefaultJsonProtocol { | |
| override protected def extractFieldNames(classTag: ClassTag[_]) = super.extractFieldNames(classTag).map {_.underscore} | |
| override protected def fromField[T](value: JsValue, fieldName: String)(implicit reader: JsonReader[T]) = | |
| super.fromField(value, fieldName.camelCase)(reader) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment