Data::Sah::Filter::perl::Str::try_decode_json - JSON-decode if we can, otherwise leave string as-is
This document describes version 0.001 of Data::Sah::Filter::perl::Str::try_decode_json (from Perl distribution Data-Sah-Filter-perl-Str-try_decode_json), released on 2020-02-11.
Use in Sah schema's
This rule is sometimes convenient if you want to accept unquoted string or a data structure (encoded in JSON). This means, compared to just decoding from JSON, you don't have to always quote your string. But beware of traps like the bare values
false becoming undef/1/0 in Perl instead of string literals, because they can be JSON-decoded.
Please visit the project's homepage at https://metacpan.org/release/Data-Sah-Filter-perl-Str-try_decode_json.
Source repository is at https://github.com/perlancar/perl-Data-Sah-Filter-perl-Str-try_decode_json.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Sah-Filter-perl-Str-try_decode_json
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
This software is copyright (c) 2020 by firstname.lastname@example.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.