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.

Qwiratry::Format::JSON v0.0.1

JSON format backend for Qwiratry using JSON::Fast

Authors

    License

    Dependencies

    Test Dependencies

    Provides

    • Qwiratry::Format::JSON

    Documentation

    The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

    Built with Podlite — the markup and publishing tools behind this site.