Created
July 8, 2013 21:19
-
-
Save levinotik/5952596 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
| case class GoogleApiResult(results: Results, status: String) | |
| case class AddressComponent(long_name: String, short_name: String, types: List[String]) | |
| case class Location(lat: Double, lng: Double) | |
| case class Bounds(northeast: Location, southwest:Location) | |
| case class Viewport(northeast: Location, southwest:Location) | |
| case class Geometry(bounds: Bounds, location: Location, locationType: String, viewport: Viewport) | |
| case class Results(address_components: List[AddressComponent], formatted_address:String, geometry: Geometry, types: List[String]) | |
| import SprayJsonSupport._ | |
| object MyJsonProtocol extends DefaultJsonProtocol { | |
| implicit val locationFormat = jsonFormat2(Location) | |
| implicit val boundsFormat = jsonFormat2(Bounds) | |
| implicit val addressComponentsFormat = jsonFormat3(AddressComponent) | |
| implicit val viewportFormat = jsonFormat2(Viewport) | |
| implicit val geometryFormat = jsonFormat4(Geometry) | |
| implicit val resultsFormat = jsonFormat4(Results) | |
| implicit val googleApiResult = jsonFormat2(GoogleApiResult) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment