[ https://issues.apache.org/jira/browse/ATLAS-543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15240998#comment-15240998 ]
Shwetha G S commented on ATLAS-543: ----------------------------------- +1 > Entity Instance requests should not require ID element for new Entities > ----------------------------------------------------------------------- > > Key: ATLAS-543 > URL: https://issues.apache.org/jira/browse/ATLAS-543 > Project: Atlas > Issue Type: Bug > Affects Versions: 0.6-incubating > Environment: Ubuntu 14, OpenJDK 64-Bit 1.7.0_95 > Reporter: Joseph Niemiec > Assignee: Harish Jaiprakash > Priority: Minor > Attachments: ATLAS-543.patch > > > When utilizing the REST API to create an 'new' Entity Instance of a given > Type all ID elements for the class and structs are required, requests without > these elements will fail despite the fact a random GUID will be assigned at > instance time. > ##### > Example 1 (Good Entity Posts correctly) > ##### > { > "jsonClass": > "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference", > "id": { > "jsonClass": > "org.apache.atlas.typesystem.json.InstanceSerialization$_Id", > "id": "-984848", > "version": 0, > "typeName": "HDFS_RESOURCE" > }, > "typeName": "HDFS_RESOURCE", > "values": { > "name": "Cluser_A_DevFolder_A", > "description": "Fully Public Dev Folder", > "resource": { > "jsonClass": > "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference", > "id": { > "jsonClass": > "org.apache.atlas.typesystem.json.InstanceSerialization$_Id", > "id": "-2630837415522", > "version": 0, > "typeName": "HDFS_OBJECT" > }, > "typeName": "HDFS_OBJECT", > "values": { > "uri": "/user/dev/a", > "isDir" : true > }, > "traitNames": [], > "traits": {} > } > }, > "traitNames": ["Public"], > "traits": { > "Public": { > "jsonClass": > "org.apache.atlas.typesystem.json.InstanceSerialization$_Struct", > "typeName": "Public", > "values": { } > } > } > } > #### > Example #2 Bad Entity that fails. > #### > { > "jsonClass": > "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference", > "typeName": "HDFS_RESOURCE", > "values": { > "name": "Cluser_A_DevFolder_A", > "description": "Fully Public Dev Folder", > "resource": { > "jsonClass": > "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference", > "typeName": "HDFS_OBJECT", > "values": { > "uri": "/user/dev/a", > "isDir" : true > }, > "traitNames": [], > "traits": {} > } > }, > "traitNames": ["Public"], > "traits": { > "Public": { > "jsonClass": > "org.apache.atlas.typesystem.json.InstanceSerialization$_Struct", > "typeName": "Public", > "values": { } > } > } > } -- This message was sent by Atlassian JIRA (v6.3.4#6332)