lackey

Generate Ruby clients from Servant APIs.

https://github.com/tfausak/lackey#readme

Version on this page:1.0.15
LTS Haskell 18.18:1.0.16
Stackage Nightly 2021-11-28:1.0.16
Latest on Hackage:1.0.16

See all snapshots lackey appears in

MIT licensed
Maintained by Taylor Fausak
This version can be pinned in stack with:lackey-1.0.15@sha256:7dea158b52f407e724945c791391c10e38490f9d9c9c7f3e83f778c9abe3c79b,1228

Module documentation for 1.0.15

Lackey

CI Hackage Stackage

Lackey is a Haskell library for generating Ruby consumers of Servant APIs.

Use Lackey.rubyForAPI to generate a string of Ruby source code for consuming a Servant API. For example:

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}

import qualified Data.Proxy as Proxy
import qualified Data.Text as Text
import qualified Data.Text.IO as Text
import qualified Lackey
import Servant.API

type API = "words" :> Get '[JSON] [String]

api :: Proxy.Proxy API
api = Proxy.Proxy

ruby :: Text.Text
ruby = Lackey.rubyForAPI api

main :: IO ()
main = Text.putStrLn ruby
-- def get_words(excon)excon.request(:method=>:get,:path=>"/words",:headers=>{},:body=>nil)end

The generated functions require Excon.