Skip to content

Latest commit

 

History

History
121 lines (100 loc) · 3.68 KB

CHANGELOG.md

File metadata and controls

121 lines (100 loc) · 3.68 KB

0.2.0

  • StatusCodes and MediaTypes are in distinct objects, thus, have to be imported explicitly
  • improved Ammonite integration
  • internal: separated decoded and raw requests with RawApiRequest and ApiRequest
  • fixed implicitNotFound message for ApiRequest
  • implemented #31 #35 #36
  • server endpoints have to define a response code:
derive[IO](Api) { input =>
  success(/*...*/)
     ^
}

0.1.0

  • internal cleanups and refactorings

  • extended example project and added ScalaJS client

  • centralized http-support specs

  • added akka-http support on server and client-side

  • added scalaj-http support on the client-side

  • added ScalaJS compilation support for shared and client code

  • implemented basic ScalaJS client

  • added body encoding types and made them mandatory (several hundred Mediatypes supported)

    := :> ReqBody[Json, User] :> Get[Json, User]
     _______________^__________________^
  • RawHeaders was removed

  • fixed headers were added; a fixed header is a statically known key-value pair, therefore, no input is required

    // dsl
    := :> Header("Access-Control-Allow-Origin", "*") :> Get[Json, User]
    
    // function
    api(Get[Json, User], headers = Headers add("Access-Control-Allow-Origin", "*"))
  • changes to the server API:

    • NoReqBodyExecutor and ReqBodyExecutor now expect a MethodType:
    new NoReqBodyExecutor[El, KIn, VIn, M, F, FOut] {
    ____________________________________^
    
    new ReqBodyExecutor[El, KIn, VIn, Bd, M, ROut, POut, F, FOut] {
    ______________________________________^
    • fixed header only sent by the server
    := :> Server.Send("Access-Control-Allow-Origin", "*") :> Get[Json, User]
    
    api(Get[Json, User], Headers.serverSend("Access-Control-Allow-Origin", "*"))
    • extract headers which have keys that match a String
    := :> Server.Match[String]("Control") :> Get[Json, User]
    
    api(Get[Json, User], Headers.serverMatch[String]("Control"))
  • changes to the client API:

    • new encoding types add Content-Type and Accept headers
    • fixed header only sent by the client
    := :> Client.Header("Access-Control-Allow-Origin", "*") :> Get[Json, User]
    
    api(Get[Json, User], Headers.client("Access-Control-Allow-Origin", "*"))
    • send dynamic header ignore it on the server-side
    := :> Client.Header[String]("Foo") :> Get[Json, User]
    
    api(Get[Json, User], Headers.client[String]("Foo"))

0.1.0-RC5 / Almost there

  • changes to the client API:
val ApiList =
  (:= :> Get[Foo]) :|:
  (:= :> RequestBody[Foo] :> Put[Foo])
  
// `:|:` removed for API compositions
val (get, put) = deriveAll(ApiList)
  • changes to the server API:
// same for endpoint compositions
val e = deriveAll[IO](ApiList).from(get, put)

0.1.0-RC4 / Towards a stable API

  • changes to the client API:
val Api     = := :> Get[Foo]
val ApiList =
  (:= :> Get[Foo]) :|:
  (:= :> RequestBody[Foo] :> Put[Foo])

// not `compile`, but
val foo = derive(Api)

val (foo2 :|: bar :|: =:) = deriveAll(ApiList)

...
// explicitly pass ClientManager
foo().run[IO](cm)
_______________^
  • changes to the server API
// not `link.to`, but
val endpoint = derive[IO](Api).from(...)

val endpoints = deriveAll[IO](ApiList).from(...)
  • major changes were applied to the internal code to reach a stable state (see this PR)