You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Joseph Niemiec <jo...@gmail.com> on 2016/02/27 17:58:30 UTC

Entity Types Need Overly Verbose JSON

Hi Atlas Dev,

I have recently been playing around with making my own custom types. After
much work I came to realize that even if an element would be empty it has
to be included in the message itself, examples of this would be:
traitNames, traits, and values which can often be completely blank.

To reduce overhead and datasize would it not be better to treat it so that
if the values (when part of traits, or just blank), traitNames and/or
traits is missing that is it blank and not completely fail during JSON
de-serialization?


{
"jsonClass":
"org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
"id": {
"jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
"id": "-19029388374",
"version": 0,
"typeName": "CUSTOM"
},
"typeName": "CUSTOM",
"values": {
"name": "A",
"description": "Non Prod",
},
* "traitNames": [],*
* "traits": {}*
}

-- 
Joseph

Re: Entity Types Need Overly Verbose JSON

Posted by Shwetha Shivalingamurthy <ss...@hortonworks.com>.
Hi Joseph,

Yes, it makes sense to not have empty attributes in json. Can you file a
bug?

Regards,
Shwetha


On 27/02/16, 10:28 PM, "Joseph Niemiec" <jo...@gmail.com> wrote:

>Hi Atlas Dev,
>
>I have recently been playing around with making my own custom types. After
>much work I came to realize that even if an element would be empty it has
>to be included in the message itself, examples of this would be:
>traitNames, traits, and values which can often be completely blank.
>
>To reduce overhead and datasize would it not be better to treat it so that
>if the values (when part of traits, or just blank), traitNames and/or
>traits is missing that is it blank and not completely fail during JSON
>de-serialization?
>
>
>{
>"jsonClass":
>"org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
>"id": {
>"jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
>"id": "-19029388374",
>"version": 0,
>"typeName": "CUSTOM"
>},
>"typeName": "CUSTOM",
>"values": {
>"name": "A",
>"description": "Non Prod",
>},
>* "traitNames": [],*
>* "traits": {}*
>}
>
>-- 
>Joseph