# `Oaskit.SpecDumper`
[🔗](https://github.com/lud/oaskit/blob/v0.13.1/lib/oaskit/spec_dumper.ex#L1)

A helper to render an OpenAPI specification to JSON format.

# `to_json!`

Returns a JSON representation of the given OpenAPI specification. The
specification must be in normal form (binary keys, no atoms besides booleans
and `nil`).

### Options

* `:pretty` - A boolean to control JSON pretty printing. JSON object keys will
  be ordered if the available JSON library (`Jason`, `JSON`) supports it. Key
  ordering is custom (for instance, the `openapi` key is always first).
* `:validation_error_handler` - A function accepting a `JSV.ValidationError`
  struct. The JSON generation does not fail on validation error unless you
  raise from that function.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
