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
// summary : ZIO learning - playing with json - zio-json cheat sheet | |
// keywords : scala, zio, learning, json, pure-functional, @testable | |
// publish : gist | |
// authors : David Crosson | |
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2) | |
// license-url : | |
// id : 862c2592-c58c-4541-817b-eaf9da4c762e | |
// created-on : 2021-12-30T10:57:55+01:00 | |
// managed-by : https://github.com/dacr/code-examples-manager | |
// run-with : scala-cli $file |
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.fasterxml.jackson.databind.ObjectMapper | |
import com.fasterxml.jackson.module.scala.DefaultScalaModule | |
import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper | |
import spray.http.{ContentTypes, HttpCharsets, HttpEntity, MediaTypes} | |
import spray.httpx.marshalling.Marshaller | |
import spray.httpx.unmarshalling.Unmarshaller | |
/** | |
* Use Jackson directly to avoid json4s's dependencies | |
*/ |
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
package com.scalawilliam.example.play | |
import play.api.libs.ws._ | |
/** | |
* Play's Scala WS library is very very cool. Provides you with plenty niceties. | |
* See more: https://www.playframework.com/documentation/2.3.x/ScalaWS | |
* | |
* Unfortunately it by default requires a Play application context. | |
* But you do not necessarily always want that. |