Anybody seen an $.id, non-textural but non-integral value?

103 views
Skip to first unread message

Jin Kwon

unread,
Jun 28, 2020, 9:36:00 AM6/28/20
to JSON-RPC
Hi I'm writing libraries for binding JSON-RPC 2.0 in Java

Has anyone ever seen any implementation or production which meets one of following condition?

* $.id is not textual yet has a fractional part.
* $.id is not textual yet is bigger than 2^63?



{
  "id": 12534344.124
}

{
 "id": 10000009223372036854775807
}

Thanks.

Nathan Fischer

unread,
Jun 29, 2020, 9:36:08 PM6/29/20
to JSON-RPC
The spec says
> Numbers SHOULD NOT contain fractional parts
so I've not seen any that violate that rule.

> $.id is not textual yet is bigger than 2^63?
I have not seen that, but logically if you want a very large number it begins to make sense to use a base64 encoded string over a number literal.

welfor...@gmail.com

unread,
Oct 21, 2020, 10:35:35 AM10/21/20
to JSON-RPC
As per the spec, a number is not allowed to contain fractional parts in the JSONRPC spec

I think that the confusion comes up from the JSON specification which explicitly defined Numbers as allowing fractional https://tools.ietf.org/html/rfc8259#section-6, I think to correct that we should use the Terminology Integer and define Integer as " The representation of integers is similar to that used in most programming languages,   An integer is represented in base 10 using decimal digits. That may be prefixed with an optional minus sign it may not contain a fictional or an exponent part" 
Reply all
Reply to author
Forward
0 new messages