All Downloads are FREE. Search and download functionalities are using the official Maven repository.

endpoints4s.algebra.JsonTestApi.scala Maven / Gradle / Ivy

The newest version!
package endpoints4s.algebra

import endpoints4s.algebra

trait JsonTestApi extends algebra.Endpoints with algebra.JsonEntities {

  implicit def userCodec: JsonRequest[User]
  implicit def addresCodec: JsonResponse[Address]

  val jsonEndpoint = endpoint(
    post(path / "user", jsonRequest[User]),
    ok(jsonResponse[Address])
  )

}

case class User(name: String, age: Int)

case class Address(street: String, city: String)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy