lackey

Generate Ruby clients from Servant APIs.

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

Version on this page:1.0.11
LTS Haskell 16.31:1.0.13
Stackage Nightly 2021-04-06:1.0.14
Latest on Hackage:1.0.14

See all snapshots lackey appears in

MIT licensed
Maintained by Taylor Fausak
This version can be pinned in stack with:lackey-1.0.11@sha256:15420bf12c5ba3e72aadd31e56b12207996472450ff2370f502ddd41679a795f,1589

Module documentation for 1.0.11

Lackey

Version badge Build badge

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.

Changes

Change log

Lackey uses Semantic Versioning. The change log is available through the releases on GitHub.