Subject: | How to provide JSON::true JSON::false values? |
in json there are true and false boolean values. which are not 100% analogous to 1 & 0 in perl. the JSON modules provide JSON::true and JSON::false as helpers to allow them to be explicitly requested.
if i take this example...
# Return a 200 OK, with the data in entity
# serialized in the body
$self->status_ok(
$c,
entity => {
success => 1,
results => \%results,
},
);
ideally i should write success => JSON::true or something similar, however the ibject gets serialised instead.
json's bool types would obviously become problematic with other serializers.
hence i am curious what is the correct approach (if there is one) ?