Re: [VOTE] JSON number to string
| From: | Yasuo Ohgaki | Date: | Wed, 10 Jun 2015 11:00:43 +0000 |
| Subject: | Re: [VOTE] JSON number to string | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86545@lists.php.net to get a copy of this message | ||
On Wed, Jun 10, 2015 at 7:57 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
> On Wed, Jun 10, 2015 at 7:28 PM, Derick Rethans <derick@php.net> wrote:
>
>> > Hi,
>> >
>> > The voting is now open:
>> >
>> > https://wiki.php.net/rfc/json_numeric_as_string#voting
>>
>> FWIW, I voted no to all of them because (as you even say in the RFC),
>> this is probably better be solved with a JSON schema thingy.
>
>
> JSON Schema does not help to decoding/encoding numeric data without
> loosing data.
>
> JSON Schema Core
> http://json-schema.org/latest/json-schema-core.html#anchor8
> Note: JSON specification does not specify precision. So number could be
> any number.
>
> JSON Schema Validation
>
> http://json-schema.org/latest/json-schema-validation.html#anchor5
>
> Those who do not care rounding errors/etc, they can use default behavior.
>
JSON Schema could be used to encode huge numbers correctly, so I would like
to have it in the future also.
--
Yasuo Ohgaki
yohgaki@ohgaki.net