NAME

Getopt::Pad::Config::Format::Json - The json config file format

SYNOPSIS

config => { format => 'json', paths => ['~/.tool.json'] },
{
  "Options": { "log-level": "debug", "tag": ["a", "b"] },
  "commands": { "resize": { "Options": { "width": 800 } } }
}

DESCRIPTION

The config file format json, based on JSON::PP, which comes with Perl. Files are parsed as strict JSON: comments and trailing commas are errors. true and false become plain 1 and 0, which flag and bool options accept and other options read as values (a string option set to true reads 1). null is reported as no value given (for hash and objectlist options as a value of the wrong shape). An empty file, or one with only white space, sets nothing. Numbers reach the options as written, so a large integer is not rounded to a float first (see "bigint" in Getopt::Pad).

--create-default-config writes indented JSON with the keys sorted.

See "CONFIG FILES" in Getopt::Pad for the layout of config files.

SEE ALSO

Getopt::Pad::Config::Format, Getopt::Pad::Config::Format::Yaml

AUTHOR

davenonymous <perl@davenonymous.com>

COPYRIGHT AND LICENSE

Copyright 2026 davenonymous

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.