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 are accepted for flag and bool options. null is reported as no value given (for hash and objectlist options as a value of the wrong shape). An empty file is a parse error; a file that sets nothing contains {}.

--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.