Ayub Khan created ATLAS-1614:
--------------------------------

             Summary: Regression: NegativeTest: Partial update REST API call to 
set string as float is accepted by atlas(200 OK) and float value is set as 0. 
Previously this was rejected by atlas.
                 Key: ATLAS-1614
                 URL: https://issues.apache.org/jira/browse/ATLAS-1614
             Project: Atlas
          Issue Type: Bug
          Components:  atlas-core
    Affects Versions: trunk, 0.8-incubating
            Reporter: Ayub Khan
            Priority: Blocker
             Fix For: trunk, 0.8-incubating


sample request:
{noformat}
2017-03-01 14:31:44,697 INFO  - [main:partialUpdateByPostInvalid] ~ Request 
payload is : {
  
"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
  "id":{
    "jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
    "id":"-16999275390902688",
    "version":0,
    "typeName":"EntityUpdateTest2szmwqubeh",
    "state":"ACTIVE"
  },
  "typeName":"EntityUpdateTest2szmwqubeh",
  "values":{
    "float":"str",
    "set":[
      "setValue1",
      "setValue2"
    ],
    "collection":[
      "collectionValue1",
      "collectionValue2"
    ],
    "name":"updateEntitiesqg8z7qbuvv"
  },
  "traitNames":[

  ],
  "traits":{

  },
  "systemAttributes":{
    "createdBy":null,
    "modifiedBy":null,
    "createdTime":null,
    "modifiedTime":null
  }
} (InstanceUtils:157)
2017-03-01 14:31:44,698 INFO  - [main:partialUpdateByPostInvalid] ~ Request 
Url: 
http://ctr-e129-1487033772569-29425-01-000006.hwx.site:21000/api/atlas/entities/qualifiedName?user.name=hrt_qa&type=EntityUpdateTest2szmwqubeh&property=name&value=updateEntitiesqg8z7qbuvv
 (BaseRequest:165)
{noformat}


Response for this is:
{noformat}
Response is: {"requestId":"pool-2-thread-9 - 
1dce7307-6b3e-44bc-9566-d49e89de3894","entities":{"updated":["66e86cc9-2307-4ced-ab83-0301fb388296"]},"definition":{"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Reference","id":{"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Id","id":"66e86cc9-2307-4ced-ab83-0301fb388296","version":0,"typeName":"EntityUpdateTest2szmwqubeh","state":"ACTIVE"},"typeName":"EntityUpdateTest2szmwqubeh","values":{"name":"updateEntitiesqg8z7qbuvv","collection":["collectionValue1","collectionValue2"],"float":0,"short":0,"set":["setValue1","setValue2"],"optional":null,"double":0,"long":0,"biginteger":0,"boolean":false,"date":"1970-01-01T00:00:00.000Z","bigdecimal":0,"int":0,"byte":0},"traitNames":[],"traits":{},"systemAttributes":{"createdBy":"admin","modifiedBy":"admin","createdTime":"2017-03-01T14:31:44.575Z","modifiedTime":"2017-03-01T14:31:44.706Z"}}}
{noformat}

Previously the same request used to be rejected by atlas but now it is accepted 
and reflected as 0 in the response. Is this new implementation? If yes, this 
mean any value for any type is accepted but the value for that type is set to 
default. For example: when float type is set as string, the default value set 
for float is 0.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to