Skip to content

Commit

Permalink
Document custom pretty printer options
Browse files Browse the repository at this point in the history
  • Loading branch information
dakrone committed Apr 9, 2016
1 parent e4ccfa7 commit 725b618
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ encoders.

In the event encoding fails, Cheshire will throw a JsonGenerationException.

#### Custom Pretty Printing Options

If Jackson's default pretty printing library is not what you desire, you can
manually create your own pretty printing class and pass to the `generate-string`
or `encode` methods:

```clojure
(let [my-pretty-printer (create-pretty-printer
(assoc default-pretty-print-options
:indent-arrays? true))]
(generate-string {:foo [1 2 3]} {:pretty my-pretty-printer}))
```

See the `default-pretty-print-options` for a list of options that can be
changed.

### Decoding

```clojure
Expand Down

0 comments on commit 725b618

Please sign in to comment.