JSON
Overview
JSON format backend for Qwiratry, powered by JSON::Fast.
Defines Qwiratry::Format::JSON::Parse and
Qwiratry::Format::JSON::Render implementations loaded through
Qwiratry::Format.make.
The parser lowers JSON objects to hashes, arrays to arrays, strings to Str,
numbers to Int or Num, and JSON literals to Raku booleans or undefined
values.
The renderer keeps Qwiratry's current JSONdemo behavior where it matters:
compact output by default and :pretty as an explicit opt-in. It also
supports :spacing and :sorted-keys.
Methods
parse(Str $input-string)
Parse JSON text into ordinary Raku data structures using JSON::Fast.
render(Mu $data, Associative :%options)
Render ordinary Raku data structures to JSON text using JSON::Fast.
%options<pretty> defaults to false so this backend stays compact by
default, matching Qwiratry's existing JSONdemo behavior. %options<spacing>
defaults to 2, and %options<sorted-keys> defaults to true for deterministic
output.