Skip to content

Commit

Permalink
Add some text to make readme readable
Browse files Browse the repository at this point in the history
  • Loading branch information
erewok committed Feb 13, 2017
1 parent 0c4f3db commit 542e575
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ There are two different styles of function-return supported here: `DangerMode` a

The latter returns the raw response from issuing the request and the former calls `raise_for_status` and then attempts to return `resp.json()`. You can switch which style you'd like to use by creating a proper `CommonGeneratorOptions` object.

The default options just chucks it all to the wind and goes for `DangerMode` (because, seriously, we're using Haskell to generate Python here...):
The default options just chucks it all to the wind and goes for `DangerMode` (because, seriously, we're using Haskell to generate Python here...).

Following is an example of using the Servant DSL to describe endpoints and then using `servant-py` to create Python clients for those endpoints.

#### Servant DSL API Description

``` haskell
{-# LANGUAGE DataKinds #-}
Expand Down Expand Up @@ -74,7 +77,9 @@ main :: IO ()
main = writePythonForAPI testApi requests (result </> "api.py")
```

If you build this and run it, you will get some output that looks like the following:
#### Generated Python Code

If you build the above and run it, you will get some output that looks like the following:

```python

Expand Down

0 comments on commit 542e575

Please sign in to comment.