Long type not supported. what to do

2,311 views
Skip to first unread message

vishal chaudhary

unread,
Aug 31, 2012, 4:21:51 AM8/31/12
to json-...@googlegroups.com
i have a schema which mentions the type of an entity as long
but as i convert it to pojo it makes the type as object.
can anybody help me in finding out how we can convert long type in the pojo.

an example of this schema is
{
    "id": "x",
    "description": "x",
    "type": "object",
    "properties": {
        "oid": {
            "type": "long",
            "description": "Unique object ID "
        }
    }
}
now the pojo getting created shows me that oid is of object type.

Francis Galiegue

unread,
Aug 31, 2012, 4:31:29 AM8/31/12
to json-...@googlegroups.com
Hello,

First of all, you already raised this issue and I already answered:
"long" is not a valid primitive type. Use "integer".

Second, POJO conversion is not within the scope of JSON Schema: you
should ask your question on a development mailing list dedicated to
the Java API you are using.

Cheers,
--
Francis Galiegue, fgal...@gmail.com
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)

Francis Galiegue

unread,
Aug 31, 2012, 4:42:28 AM8/31/12
to json-...@googlegroups.com
On Fri, Aug 31, 2012 at 10:31 AM, Francis Galiegue <fgal...@gmail.com> wrote:
[...]
>
> First of all, you already raised this issue and I already answered:
> "long" is not a valid primitive type. Use "integer".
>

Oh, and an integer can be arbitrarily large, so your long will match,
and even integers larger than long.

vishal chaudhary

unread,
Aug 31, 2012, 4:47:22 AM8/31/12
to json-...@googlegroups.com
so you are telling that integer supports more precision than long

--
You received this message because you are subscribed to the Google Groups "JSON Schema" group.
To post to this group, send email to json-...@googlegroups.com.
To unsubscribe from this group, send email to json-schema...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/json-schema?hl=en.


Francis Galiegue

unread,
Aug 31, 2012, 5:06:58 AM8/31/12
to json-...@googlegroups.com
On Fri, Aug 31, 2012 at 10:47 AM, vishal chaudhary
<vishal....@gmail.com> wrote:
> so you are telling that integer supports more precision than long
>

Yes. 0, -1, 1, 2318981724912739187239809817827409183029718264193874,
<whatever you come up with> -- as long as it has no decimal part, it
is covered by "integer".
Reply all
Reply to author
Forward
0 new messages