Oaskit.SpecDumper (oaskit v0.6.0)

View Source

A helper to render an OpenAPI specification to JSON format.

Summary

Functions

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

Functions

to_json!(normal_spec, opts \\ [])

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.