~mna/tulip

Table of Contents

  1. Configuration

The tulip.pkg.json module exports the json package. It registers an encoder and a decoder that handles the JSON format (application/json MIME type).

#Configuration

  • encoder: table = a table with the following fields:
    • allow_invalid_numbers: boolean = encode invalid numbers (infinity, NaN). Can be set to the string "null" to encode as JSON null (default: false)
    • max_depth: integer = maximum depth to allow (default: 1000)
    • number_precision: integer = number of significant digits encoded (default: 14)
    • sparse_array: table = table with fields convert_excessive, ratio and safe (see https://www.kyne.com.au/~mark/software/lua-cjson-manual.html, default is false, 2 and 10 respectively)
  • decoder: table = a table with the following fields:
    • allow_invalid_numbers: boolean = encode invalid numbers (infinity, NaN, hexadecimal) (default: false)
    • max_depth: integer = maximum depth to decode (default: 1000)

Back to index

About this wiki

commit 3ebfbd288b8e5c95fdf8ce2027a0e94cfa1c8976
Author: Martin Angers <martin.n.angers@gmail.com>
Date:   2021-02-25T14:07:12-05:00

Update to reflect Request:validate_body
Clone this wiki
https://git.sr.ht/~mna/tulip-wiki (read-only)
git@git.sr.ht:~mna/tulip-wiki (read/write)