{"action":"created","issue":{"url":"https://api.github.com/repos/Perl-Toolchain-Gang/CPAN-Meta/issues/104","labels_url":"https://api.github.com/repos/Perl-Toolchain-Gang/CPAN-Meta/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/Perl-Toolchain-Gang/CPAN-Meta/issues/104/comments","events_url":"https://api.github.com/repos/Perl-Toolchain-Gang/CPAN-Meta/issues/104/events","html_url":"https://github.com/Perl-Toolchain-Gang/CPAN-Meta/issues/104","id":112909446,"number":104,"title":"Spec: definition of \"Boolean\" is ambiguous","user":{"login":"dolmen","id":129536,"avatar_url":"https://avatars.githubusercontent.com/u/129536?v=3","gravatar_id":"","url":"https://api.github.com/users/dolmen","html_url":"https://github.com/dolmen","followers_url":"https://api.github.com/users/dolmen/followers","following_url":"https://api.github.com/users/dolmen/following{/other_user}","gists_url":"https://api.github.com/users/dolmen/gists{/gist_id}","starred_url":"https://api.github.com/users/dolmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolmen/subscriptions","organizations_url":"https://api.github.com/users/dolmen/orgs","repos_url":"https://api.github.com/users/dolmen/repos","events_url":"https://api.github.com/users/dolmen/events{/privacy}","received_events_url":"https://api.github.com/users/dolmen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-22T23:09:13Z","updated_at":"2015-10-25T07:59:47Z","closed_at":null,"body":"META v2.0 can be serialized either as YAML or as JSON. Both formats have a specific type for boolean values.\r\nPerl 5 instead accepts various values JSON/YAML types in boolean context.\r\n\r\nThe issue is that the specification suffers from the same fuzzyness as Perl 5.\r\n\r\nFor example, the section about [Boolean type](https://metacpan.org/pod/CPAN::Meta::Spec#Boolean) says:\r\n> A Boolean is used to provide a true or false value. It must be represented as a defined value.\r\n\r\nThis is ambiguous because:\r\n- it does not says if this is JSON's `true`/`false` or any truth value recognized by Perl 5\r\n- a `defined value` in JSON means anything not `null` which would imply that any JSON `boolean`/`number`/`string`/`object`/`array` is allowed, including `false`, `0`, `\"\"` (the empty string), `{}`, `[]`. \r\n\r\nWhen `Boolean` is used in the specification, the JSON `true` / `false` value are not mentioned. The [specification of `dynamic_config`](https://metacpan.org/pod/CPAN::Meta::Spec#dynamic_config) says:\r\n> dynamic_config => 1\r\n\r\nThis implies the expected value is an integer instead of a JSON boolean.\r\n\r\nPS: I'm writing a strict specification of META v2.0 using [JSON Schema](http://www.json-schema.org/)."},"comment":{"url":"https://api.github.com/repos/Perl-Toolchain-Gang/CPAN-Meta/issues/comments/150899459","html_url":"https://github.com/Perl-Toolchain-Gang/CPAN-Meta/issues/104#issuecomment-150899459","issue_url":"https://api.github.com/repos/Perl-Toolchain-Gang/CPAN-Meta/issues/104","id":150899459,"user":{"login":"dolmen","id":129536,"avatar_url":"https://avatars.githubusercontent.com/u/129536?v=3","gravatar_id":"","url":"https://api.github.com/users/dolmen","html_url":"https://github.com/dolmen","followers_url":"https://api.github.com/users/dolmen/followers","following_url":"https://api.github.com/users/dolmen/following{/other_user}","gists_url":"https://api.github.com/users/dolmen/gists{/gist_id}","starred_url":"https://api.github.com/users/dolmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolmen/subscriptions","organizations_url":"https://api.github.com/users/dolmen/orgs","repos_url":"https://api.github.com/users/dolmen/repos","events_url":"https://api.github.com/users/dolmen/events{/privacy}","received_events_url":"https://api.github.com/users/dolmen/received_events","type":"User","site_admin":false},"created_at":"2015-10-25T07:59:47Z","updated_at":"2015-10-25T07:59:47Z","body":"CPAN::Meta::Validator currently has a stricter definition than just *anything that Perl 5 accepts in boolean context*.\r\nhttps://metacpan.org/source/DAGOLDEN/CPAN-Meta-2.150005/lib/CPAN/Meta/Validator.pm#L833\r\n```perl\r\nsub boolean {\r\n    my ($self,$key,$value) = @_;\r\n    if(defined $value) {\r\n        return 1    if($value =~ /^(0|1|true|false)$/);\r\n    } else {\r\n        $value = '<undef>';\r\n    }\r\n    $self->_error( \"'$value' for '$key' is not a boolean value.\" );\r\n    return 0;\r\n}\r\n```"}}